Skip to content

test: expand roundtrip coverage to 198 patterns + normalizations#37

Draft
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/expand-roundtrip-modern-constructs
Draft

test: expand roundtrip coverage to 198 patterns + normalizations#37
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/expand-roundtrip-modern-constructs

Conversation

@toddr-bot
Copy link
Copy Markdown
Collaborator

@toddr-bot toddr-bot commented Apr 8, 2026

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:

  • Possessive quantifiers (a++, a*+, a?+, a{3,5}+)
  • Caret flag syntax ((?^:...), (?^ims:...))
  • Named captures (Python (?P<>) syntax)
  • Recursive patterns ((?R), (?1), (?&name))
  • Backtracking verbs ((*FAIL), (*SKIP:label), (*MARK:name), etc.)
  • Alphabetic assertions ((*script_run:...), (*asr:...))
  • Branch reset (?|...)
  • \K, \R, \h/\H, \v/\V
  • Extended boundaries (\b{wb}, \b{gcb}, \B{wb})
  • Octal escapes (\o{...})
  • Quotemeta (\Q...\E)
  • (?(DEFINE)...), named conditionals
  • Flag interactions, empty alternation, nested structures

Also 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

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