Skip to content

test: add comprehensive unit tests for Template::VMethods#456

Draft
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/unit-test-vmethods
Draft

test: add comprehensive unit tests for Template::VMethods#456
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/unit-test-vmethods

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

Add 70 unit tests for Template::VMethods, testing all 63 functions across the four vmethod groups (root, text, hash, list) plus the exported table structure.

Why

VMethods is the module behind every virtual method call in TT (item.upper, list.sort, hash.keys, etc.) — a lot of user-facing surface area with no dedicated unit tests. The existing t/vmethods/ tests exercise these through the template engine; these unit tests call functions directly and verify edge cases: mutation safety for trim/collapse, $PRIVATE pattern enforcement in hash_item, Schwartzian transform sorting with hash fields and blessed objects, splice with array replacement expansion, and match behavior with/without capture groups.

How

Direct function calls into Template::VMethods::* with Test::More subtests. No template compilation needed — pure Perl I/O verification.

Testing

  • 70 subtests, all pass
  • Full suite: 3456 tests, all pass

Quality Report

Changes: 1 file changed, 614 insertions(+)

Code scan: 1 issue(s) found

  • t/unit-vmethods.t:0 — 614 lines added

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan

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