test: proptest property testing + cargo-fuzz fuzzing for donglora-cobs

This commit is contained in:
swaits committed 2026-03-30 10:57:57 -06:00
1 parent 1fbbf110bc
commit d7bb127d92
8 files changed
+567 -9

No files matched your search

+11 -1
View File
@@ -21,11 +21,21 @@ benchmark-optimized for streaming applications.
## Testing
```sh
# Unit tests + property tests + interop
cargo test -p donglora-cobs
# Fuzz testing (requires cargo-fuzz: cargo install cargo-fuzz)
cd crates/donglora-cobs
cargo +nightly fuzz run fuzz_decode -- -max_total_time=60
cargo +nightly fuzz run fuzz_roundtrip -- -max_total_time=60
```
Tests include:
- 18 canonical COBS vectors (Wikipedia / IEEE/ACM spec)
- Round-trip verification for various payload sizes
- 8 interop tests cross-validating against `corncobs` (dev-dependency)
- 8 interop tests cross-validating against `corncobs`
- 500 randomized round-trip payloads verified against `corncobs`
- **5 proptest properties** (~1280 random inputs): round-trip, interop
encode/decode both directions, length bounds, decode-never-panics
- **2 fuzz targets**: `fuzz_decode` (arbitrary bytes → must not panic)
and `fuzz_roundtrip` (encode→decode must match)