Skip to content

Add approx integer parsing error-path test coverage#466

Merged
Licenser merged 1 commit into
simd-lite:mainfrom
mag123c:approx-parse-error-coverage
Jul 14, 2026
Merged

Add approx integer parsing error-path test coverage#466
Licenser merged 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.

@Licenser Licenser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!!!

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.
@Licenser Licenser force-pushed the approx-parse-error-coverage branch from 39b16bb to 7ebf413 Compare July 14, 2026 12:41
@Licenser Licenser enabled auto-merge (squash) July 14, 2026 12:41
@Licenser Licenser merged commit c8cece0 into simd-lite:main Jul 14, 2026
29 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.

2 participants