Add two proptests for the PDF hex string lexer to verify robustness and correctness: 1. proptest_hex_string_never_panics_on_random_bytes: Random byte sequences starting with '<' (not '<<') never cause panics. 2. proptest_hex_string_roundtrip_via_reencode: Hex decode + re-encode roundtrip property validates that encoding and decoding are inverse operations. The hex string lexer implementation was already present and correct, with proper handling of odd-length zero padding (<4> -> \x40, not \x04). All acceptance criteria pass: - Empty hex string: <> -> b"" - Odd-length single nibble: <4> -> b"\x40" (critical test) - Standard decoding: <48656C6C6F> -> b"Hello" - Mixed case: <aBcD> -> b"\xAB\xCD" - Whitespace ignored: <48 65> -> b"\x48\x65" - Unterminated with diagnostic: <48 -> b"\x48" + STRUCT_UNTERMINATED_STRING - Proptests pass: random bytes never panic, roundtrip property holds - INV-8 maintained: all error paths use diagnostics, no panics Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||