Skip to content

Commit 7b3b6fb

Browse files
committed
test: add comprehensive test suite with edge cases and fuzzing
- Add property-based fuzz tests using fast-check for imports-parser - Add edge case tests for nested fences, weird backticks, indented fences - Add extended schema validation tests for frontmatter parsing - Add integration tests for command building and template substitution - Add extended template tests for strict vs non-strict mode - Add extended trust/known_hosts tests for domain extraction Tests verify: - Parser never panics on random/unicode input - Safe ranges never overlap and stay within bounds - Imports only appear in safe ranges outside code blocks - Correct handling of shebangs, symbols, globs, line ranges - Template variable extraction and substitution edge cases - Trust decisions and known_hosts persistence
1 parent f5ad522 commit 7b3b6fb

File tree

8 files changed

+1722
-0
lines changed

8 files changed

+1722
-0
lines changed

bun.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@types/bun": "latest",
2929
"@types/js-yaml": "^4.0.9",
3030
"@types/mdast": "^4.0.4",
31+
"fast-check": "^4.4.0",
3132
"semantic-release": "^25.0.2",
3233
},
3334
"peerDependencies": {
@@ -270,6 +271,8 @@
270271

271272
"extend": ["[email protected]", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="],
272273

274+
"fast-check": ["[email protected]", "", { "dependencies": { "pure-rand": "^7.0.0" } }, "sha512-s87BFAp8YaWYOBXjbTxeotaOhmA4hPYAyk9gBTFxdab25P6eAlqrryUvVMA2qd9bT/0Xq+YNJGtoVhJd/BxI4g=="],
275+
273276
"fast-content-type-parse": ["[email protected]", "", {}, "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg=="],
274277

275278
"fast-copy": ["[email protected]", "", {}, "sha512-/oA0gx1xyXE9R2YlV4FXwZJXngFdm9Du0zN8FhY38jnLkhp1u35h6bCyKgRhlsA6C9I+1vfXE4KISdt7xc6M9w=="],
@@ -556,6 +559,8 @@
556559

557560
"pump": ["[email protected]", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA=="],
558561

562+
"pure-rand": ["[email protected]", "", {}, "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ=="],
563+
559564
"quick-format-unescaped": ["[email protected]", "", {}, "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="],
560565

561566
"rc": ["[email protected]", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@types/bun": "latest",
2626
"@types/js-yaml": "^4.0.9",
2727
"@types/mdast": "^4.0.4",
28+
"fast-check": "^4.4.0",
2829
"semantic-release": "^25.0.2"
2930
},
3031
"peerDependencies": {

0 commit comments

Comments
 (0)