Skip to content

test: comprehensive walker API tests (517 new tests)#50

Merged
toddr merged 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/comprehensive-walker-tests
Apr 24, 2026
Merged

test: comprehensive walker API tests (517 new tests)#50
toddr merged 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/comprehensive-walker-tests

Conversation

@toddr-bot
Copy link
Copy Markdown
Collaborator

What

Adds 517 tests validating the walker() API's tree traversal across all node families.

Why

The existing t/03walker.t only tests one simple pattern (^a+b*?c{5,}d{3}$) covering quantifiers and anchors. The walker is the primary API for consuming parse results, but its output was largely unverified for groups, alternation, character classes, assertions, backreferences, conditionals, and all modern Perl 5.10+ constructs.

How

Each test case parses a pattern, walks the tree, and validates every node's depth, family, type, and visual. Covers 30+ distinct constructs including edge cases like empty groups, nested captures, and walker depth limiting. Uses done_testing since test count depends on Perl version (SKIP blocks for 5.18+ and 5.28+ features).

Testing

All 1672 tests pass (517 new + 1155 existing). Tested on Perl 5.42.

🤖 Generated with Claude Code

The existing t/03walker.t only tested quantifiers on a single pattern
(^a+b*?c{5,}d{3}$). This adds 517 tests validating tree structure for:

- Capturing and non-capturing groups
- Alternation (bare and in groups)
- Character classes (literal, range, negated, shorthand)
- All assertion types (lookahead, lookbehind, atomic)
- Backreferences and named captures
- Conditionals (with and without else branch)
- Flag groups and caret flags
- Anchors and word boundaries
- Unicode properties
- Possessive quantifiers
- Branch reset groups
- Recursive patterns and backtracking verbs
- Script runs and extended character classes
- Walker depth parameter (0, 1, -1)
- Nested groups and quantified groups
- Complex multi-construct patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review April 24, 2026 15:22
@toddr toddr merged commit 73bee51 into cpan-authors:main Apr 24, 2026
20 checks passed
@toddr-bot toddr-bot deleted the koan.toddr.bot/comprehensive-walker-tests branch April 25, 2026 15:55
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