Skip to content

Add test coverage for ascii_string/utf8_string min/max - #153

Merged
josevalim merged 2 commits into
dashbitco:masterfrom
dkuku:dk/string-combinator-tests
Aug 10, 2026
Merged

Add test coverage for ascii_string/utf8_string min/max#153
josevalim merged 2 commits into
dashbitco:masterfrom
dkuku:dk/string-combinator-tests

Conversation

@dkuku

@dkuku dkuku commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

While looking at the code I found two gaps in the current test suite:

  • generate/1 had no coverage for ascii_string/utf8_string at all, so nothing exercised the combinators these expand to.
  • every utf8_string test used an empty range.

These characterise existing behaviour and pass unchanged against the current implementation.

dkuku and others added 2 commits August 9, 2026 21:32
Two gaps in the current suite:

  * `generate/1` had no coverage for `ascii_string`/`utf8_string` at all,
    so nothing exercised the combinators these expand to.

  * every `utf8_string` test uses an empty range. An empty range may match
    a newline, which is the condition that decides whether the combinator
    needs per-codepoint line tracking, so the newline-free case was never
    covered. The added tests pin both it and a `[not: ?\n]` class that must
    stop the scan at the newline.

These characterise existing behaviour and pass unchanged against the
current implementation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@josevalim
josevalim merged commit 083498e into dashbitco:master Aug 10, 2026
0 of 2 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

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