test: expand roundtrip coverage to 198 patterns + normalizations#37
Draft
toddr-bot wants to merge 1 commit into
Draft
Conversation
Add comprehensive round-trip testing for all modern Perl regex constructs: possessive quantifiers, caret flags, recursive patterns, backtracking verbs, alphabetic assertions, branch reset, \K/\R/\h/\v, extended boundaries, octal escapes, quotemeta, (?(DEFINE)), named conditionals, flag interactions, and complex real-world combinations. Also add normalization verification: alphabetic assertions → standard syntax, Python (?P<>) → Perl (?<>), redundant curly quantifiers. Total: 198 roundtrip patterns + 11 normalization checks = 418 tests (up from 96 patterns / 192 tests). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Expands the roundtrip test suite from 96 to 198 patterns (418 total tests),
covering all modern Perl 5.10+ regex constructs.
Why
The existing roundtrip test only covered classic Perl 5 syntax — no verbs,
no recursive patterns, no possessive quantifiers, no extended boundaries.
Every modern construct added in recent PRs (#20-#31) lacked roundtrip
regression coverage.
How
Added patterns organized by feature area:
a++,a*+,a?+,a{3,5}+)(?^:...),(?^ims:...))(?P<>)syntax)(?R),(?1),(?&name))(*FAIL),(*SKIP:label),(*MARK:name), etc.)(*script_run:...),(*asr:...))(?|...)\K,\R,\h/\H,\v/\V\b{wb},\b{gcb},\B{wb})\o{...})\Q...\E)(?(DEFINE)...), named conditionalsAlso added 11 normalization tests verifying syntactic sugar resolves
correctly (alphabetic assertions → standard, Python → Perl, curly → simple).
Testing
make test— all 1364 tests pass (up from ~1190).🤖 Generated with Claude Code
Quality Report
Changes: 1 file changed, 175 insertions(+), 1 deletion(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline