Repository navigation
test(engine): the round trip checks that long digit strings typed as numbers keep their digits - #1932
Conversation
…ped number keeps them Text a reader types as a number is a declared change only when the number keeps every digit (a whole number exactly, a decimal at its own precision), as the readers now type text (opengeos#1924). The generator makes identifiers past i64 and decimals past 17 digits. Against the reader before opengeos#1924, seed 1 fails at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| (Value::Text(x), Value::Null) if x.trim().is_empty() => "blank text became null".into(), | ||
| (Value::Text(x), Value::Text(y)) if x.trim() == y.trim() => "text trimmed".into(), | ||
| (Value::Text(x), _) if reads_as(x, b) => "text became a number".into(), | ||
| (Value::Text(x), _) if reads_as(x, b) && keeps_digits(x, b) => "text became a number".into(), |
There was a problem hiding this comment.
Small diagnostic gap, not a correctness problem. When text reads as the same f64 but keeps_digits is false (e.g. 12345678901234567000 read back as Float), the arm falls through and the failure reads as text changed to float, which doesn't say why it failed. Naming that case in its own arm makes the failure actionable for whoever hits it:
| (Value::Text(x), _) if reads_as(x, b) && keeps_digits(x, b) => "text became a number".into(), | |
| (Value::Text(x), _) if reads_as(x, b) && keeps_digits(x, b) => "text became a number".into(), | |
| (Value::Text(x), _) if reads_as(x, b) => "text became a number that drops digits".into(), |
This is a quality point; it can wait for the release quality pass if you prefer.
There was a problem hiding this comment.
Left for the release quality pass: the failure already shows the text and the number (Text("…") → Float(…)), which says what was lost; a more specific label is wording.
Code reviewBugs: None found. I traced Security: None found. The change is test-only and adds no input handling outside the test. Performance: None found. The new strategy arm adds a small fixed sample set. Quality:
AGENTS.md: Compliant. No Low-confidence notes (not posted):
Already raised: 0. There were no earlier review threads on this PR. Change sizeCompared with the base branch (the whole PR: merge base ff056d8 to PR head 71d9413).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
A follow-up to #1904, from review there: the never-silent round trip now makes long digit strings and checks that a reader that types them as numbers keeps every digit.
i64(12345678901234567891,12345678901234567000,-99999999999999999999),2^53 + 1, and a decimal past 17 significant digits.f64passed, so a rounded identifier would have been allowed.Testing
io.rsput back), seed 1 fails at once:csv: changed without a notice: ["text changed to number (a: Text(\"0.12345678901234567891\") → Float(0.12345678901234568))"].cargo fmt, and the fork's CI.Related issue
None.
Summary by CodeRabbit