Skip to content

Add approx integer parsing error-path test coverage#466

Open
mag123c wants to merge 1 commit into
simd-lite:mainfrom
mag123c:approx-parse-error-coverage
Open

Add approx integer parsing error-path test coverage#466
mag123c wants to merge 1 commit into
simd-lite:mainfrom
mag123c:approx-parse-error-coverage

Conversation

@mag123c

@mag123c mag123c commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Follows up on #465 — the maintainer offered to merge the same coverage for the approx parser.

What

  • Add InvalidNumber error-path tests for the approx-number-parsing integer parser, mirroring the correct-parser coverage from Add integer parsing error-path test coverage #465.
    • Covers leading zeroes, base prefixes (0x/0b/0o), a bare/invalid sign, an exponent marker with no digits, and non-terminator trailing bytes.
  • Add a to_value_from_str test helper matching the one in correct.rs.

Notes

  • Test-only change: approx.rs's parse_number already rejected these inputs, the paths were simply untested.
  • Verified with cargo test --features approx-number-parsing and cargo fmt --check.

Mirrors the correct-parser coverage for the approx-number-parsing
feature: leading zeroes, base prefixes (0x/0b/0o), a bare/invalid
sign, integers with an exponent marker but no exponent digits, and
non-terminator trailing bytes. These InvalidNumber paths in the
approx parse_number were previously untested.
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