test: add 127 unit tests for under-tested core modules#339
Merged
atoomic merged 1 commit intoabw:masterfrom Mar 5, 2026
Merged
test: add 127 unit tests for under-tested core modules#339atoomic merged 1 commit intoabw:masterfrom
atoomic merged 1 commit intoabw:masterfrom
Conversation
Add focused unit tests for methods that previously lacked direct test coverage across four core Template Toolkit modules: - Context: localise/delocalise, visit/leave, reset, define_block, define_filter, define_vmethod, filter caching, plugin loading, debugging control, stash accessor (45 tests) - Stash: clone/declone lifecycle, import parameter, nested cloning, define_vmethod for all types (scalar/hash/list/item/array), undefined behavior in strict/non-strict modes (32 tests) - Document: as_perl serialization, write_perl_file, metadata escaping, block/blocks/variables accessors, AUTOLOAD (28 tests) - Config: load/preload, constants namespace, instdir with and without INSTDIR set (22 tests) Total test count: 2961 → 3088 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
Add 127 focused unit tests across 4 new test files targeting previously under-tested methods in core TT modules.
Why
Several important methods in Context, Stash, Document, and Config lacked direct unit test coverage — they were only tested indirectly through integration tests. This makes it harder to catch regressions in specific methods and leaves edge cases uncovered.
How
Four new test files, each targeting a specific module's coverage gaps:
t/context_methods.t(45 tests): localise/delocalise, visit/leave, reset, define_block, define_filter, define_vmethod, filter caching/aliasing, plugin loading/errors, debugging controlt/stash_clone.t(32 tests): clone/declone lifecycle, import parameter, nested cloning, define_vmethod for all type aliases, undefined behavior in strict/non-strict modest/document_methods.t(28 tests): as_perl serialization, write_perl_file (success + error paths), metadata escaping, block/blocks/variables accessorst/config_methods.t(22 tests): load/preload (success + failure), constants namespace, instdir with/without INSTDIRTesting
Full test suite passes: 3088 tests across 111 files (was 2961 across 107 files).
🤖 Generated with Claude Code