test: add comprehensive unit tests for Template::VMethods#456
Draft
toddr-bot wants to merge 1 commit into
Draft
Conversation
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
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 existingt/vmethods/tests exercise these through the template engine; these unit tests call functions directly and verify edge cases: mutation safety fortrim/collapse,$PRIVATEpattern enforcement inhash_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::*withTest::Moresubtests. No template compilation needed — pure Perl I/O verification.Testing
Quality Report
Changes: 1 file changed, 614 insertions(+)
Code scan: 1 issue(s) found
t/unit-vmethods.t:0— 614 lines addedTests: passed (OK)
Branch hygiene: clean
Generated by Kōan