Skip to content

test: add comprehensive unit tests for Template::Exception#438

Merged
toddr merged 1 commit into
mainfrom
koan.toddr.bot/test-exception
May 25, 2026
Merged

test: add comprehensive unit tests for Template::Exception#438
toddr merged 1 commit into
mainfrom
koan.toddr.bot/test-exception

Conversation

@toddr-bot

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

Copy link
Copy Markdown
Contributor

What

Adds 43 named unit tests for Template::Exception in t/unit-exception.t.

Why

The existing t/exception.t has only 15 bare ok() assertions without descriptions, covering just the happy path. Template::Exception is a core type used throughout TT — error handling reliability depends on it.

How

Uses Test::More with named assertions covering:

  • Construction variants (with/without text ref, undef text ref)
  • All accessors: type(), info(), type_info()
  • text() prepend chaining and self-reference guard
  • Stringification overload ("", eq, ne, cmp)
  • Fallback operator behavior
  • select_handler() hierarchical matching (exact, ancestor, deep nesting, no match)
  • Reference values in info (hashref, arrayref)

Testing

All 43 tests pass. Full test suite passes with no regressions.

🤖 Generated with Claude Code


Quality Report

Changes: 1 file changed, 239 insertions(+)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

The existing exception.t has only 15 bare ok() assertions without
descriptions. This adds 43 named tests covering construction variants,
all accessors, text prepend chaining, stringification overload with
fallback operators, hierarchical select_handler matching, and reference
info values.

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