Skip to content

test: add comprehensive unit tests for Template::Stash#445

Merged
toddr merged 1 commit into
mainfrom
koan.toddr.bot/unit-test-stash
May 26, 2026
Merged

test: add comprehensive unit tests for Template::Stash#445
toddr merged 1 commit into
mainfrom
koan.toddr.bot/unit-test-stash

Conversation

@toddr-bot

@toddr-bot toddr-bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

What

142 unit tests for Template::Stash, the core variable resolution engine.

Why

Existing stash_clone.t covers only clone/declone/define_vmethod/undefined (32 tests). The main stash.t is an integration test using Template::Test. The core get()/set()/_dotop()/_assign() methods had zero direct unit coverage.

How

Direct method calls with Test::More, exercising every public and internal method:

  • Constructor — hash ref, flat list, empty, _PARENT override protection
  • get/set — simple keys, compound array idents, dotted strings, intermediate hash creation, default mode, private member rejection, code ref invocation
  • dotop — hash/array/object/scalar roots, vmethods, hash & array slices, code refs at indices, lvalue mode, blessed-hash fallback, method error propagation, multiple return folding, debug mode
  • _assign — hash/array/object assignment, default mode, private rejection
  • getref — simple & compound idents, mutation tracking
  • update — regular keys, import (hash & non-hash)
  • undefined — strict mode exceptions, .defined bypass (GH Can't use TABLE plugin with STRICT mode [rt.cpan.org #104569] #170), _reconstruct_ident
  • PRIVATE — default pattern, custom regex, disabled

Testing

perl -Ilib t/unit-stash.t    # 142 tests pass
make test                     # full suite passes

🤖 Generated with Claude Code


Quality Report

Changes: 1 file changed, 888 insertions(+)

Code scan: 1 issue(s) found

  • t/unit-stash.t:0 — 888 lines added

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

142 unit tests covering the core variable resolution engine:
constructor, get/set (simple, compound, dotted), dotop (hash/array/
object/scalar roots, vmethods, slices, code refs, lvalue mode),
_assign, getref, update, undefined (strict/non-strict, .defined
bypass), _reconstruct_ident, and PRIVATE pattern customization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review May 26, 2026 12:26
@toddr toddr merged commit d4598ad into main May 26, 2026
78 checks passed
@toddr toddr deleted the koan.toddr.bot/unit-test-stash branch May 26, 2026 12:26
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