Property tests for what people paste and type; a one-letter given name
src/props.rs (proptest, 256 cases each, about 3 s of cargo test) holds the rules every input must keep: any text reads as a passport zone without a panic and two lines of zone characters always parse; a composed zone reads back field by field; OCR finds the zone among other lines in either order, in lower case and with spaces, and puts back digits read as letters in the dates; a Thai number with its check digit is valid and another check digit is not; same_name is symmetric and ignores order and case; a kept position and its Google Maps and OpenStreetMap links read back, a swapped pair is outside Thailand; a form date is in range and reads back; normalize is idempotent and blocks are never empty; a diff rebuilds both versions; any change to a journal entry changes its hash, also text moved between two fields; the PDF's line wrap keeps every letter and no line starts with a mark. Their first run found a bug: the photo reader dropped a one-letter given name, since a lone K, C, E or L in filler counts as a misread <. The letter right after the << between the names is now kept (unit test a_one_letter_given_name_is_kept; the shrunk cases are in proptest-regressions/props.txt). 50,000 cases each pass. proptest without fork and timeout (rust-version 1.88; the fleet builds with 1.95). AGENTS.md says when to add one, PLAN has the fuzzing steps.
This commit is contained in:
1 parent
62a37b677a
commit
7b5ec35e7c
9 files changed
+570
-1
No files matched your search
@@ -25,6 +25,8 @@ pub mod oidc;
|
||||
pub mod pack;
|
||||
pub mod papers;
|
||||
pub mod people;
|
||||
#[cfg(test)]
|
||||
mod props;
|
||||
pub mod records;
|
||||
pub mod s3;
|
||||
pub mod seed;
|
||||
|
||||
Reference in new issue
Block a user