Skip to content

Add fuzz targets and randomized round-trip tests - #19

Merged
snshn merged 1 commit into
masterfrom
add-fuzz-targets-and-randomized-round-trip-tests
Oct 16, 2026
Merged

snshn merged 1 commit into
masterfrom
add-fuzz-targets-and-randomized-round-trip-tests

Conversation

@snshn

@snshn snshn commented Oct 16, 2026

Copy link
Copy Markdown
Member

tests/roundtrip.rs runs deterministic randomized checks (5000 iterations
each by default, DATAURL_ROUNDTRIP_ITERATIONS for more): parsing never
panics, and anything that parses or gets set survives being serialized
and parsed again, with every combination of encoding and escaping, with
the second round being identical to the first.

The same checks (tests/common/roundtrip.rs) back two cargo-fuzz targets
in fuzz/, which isn't part of the published crate.

Parsing can't allocate more than a small multiple of its input, since
decoded data is never larger than the input; that's now documented,
instead of adding a size limit option that wouldn't protect anything.

@snshn
snshn merged commit c56b343 into master Oct 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant