Skip to content

test: add 127 unit tests for under-tested core modules#339

Merged
atoomic merged 1 commit intoabw:masterfrom
atoomic:koan.atoomic/improve-test-coverage
Mar 5, 2026
Merged

test: add 127 unit tests for under-tested core modules#339
atoomic merged 1 commit intoabw:masterfrom
atoomic:koan.atoomic/improve-test-coverage

Conversation

@Koan-Bot
Copy link
Contributor

@Koan-Bot Koan-Bot commented Mar 5, 2026

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 control
  • t/stash_clone.t (32 tests): clone/declone lifecycle, import parameter, nested cloning, define_vmethod for all type aliases, undefined behavior in strict/non-strict modes
  • t/document_methods.t (28 tests): as_perl serialization, write_perl_file (success + error paths), metadata escaping, block/blocks/variables accessors
  • t/config_methods.t (22 tests): load/preload (success + failure), constants namespace, instdir with/without INSTDIR

Testing

Full test suite passes: 3088 tests across 111 files (was 2961 across 107 files).

🤖 Generated with Claude Code

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>
@atoomic atoomic marked this pull request as ready for review March 5, 2026 04:04
@atoomic atoomic merged commit 155edb9 into abw:master Mar 5, 2026
78 checks passed
@atoomic atoomic deleted the koan.atoomic/improve-test-coverage branch March 5, 2026 04:04
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