Skip to content

Add integer parsing error-path test coverage#465

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

Add integer parsing error-path test coverage#465
Licenser merged 1 commit into
simd-lite:mainfrom
mag123c:int-parse-error-coverage

Conversation

@mag123c

@mag123c mag123c commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Adds test coverage for integer parse errors, see #89.

parse_number had solid happy-path coverage but most of its InvalidNumber branches were untested. Added tests for:

  • leading zeroes — 01, -01
  • base prefixes — 0x1, 0b1, 0o1
  • a - not followed by a digit — -, -x
  • an exponent marker with no exponent digits — 1e, 1e+
  • non-terminator bytes after the digits — 123a, 1_000

Test-only, no parser changes. Covers the default (correct.rs) path; happy to mirror the same into the approx-number-parsing path too if you'd prefer.

Covers the InvalidNumber paths in parse_number that were previously
untested: 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. Addresses simd-lite#89.

@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.

Nice! I like it more tests are more better!

@Licenser

Copy link
Copy Markdown
Member

If you want to add the same to the apron parsing 👍 happy to merge another PR

@Licenser Licenser merged commit 4327153 into simd-lite:main Jul 13, 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