Skip to content

test: add dispatch tests and CLAUDE.md#19

Draft
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/add-dispatch-tests
Draft

test: add dispatch tests and CLAUDE.md#19
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/add-dispatch-tests

Conversation

@toddr-bot
Copy link
Copy Markdown

@toddr-bot toddr-bot commented Apr 8, 2026

Summary

  • Add t/dispatch.t with 16 tests covering Digest->new() dispatch logic
  • Add CLAUDE.md with project conventions for AI-assisted development

What: Comprehensive test coverage for the core dispatch mechanism in Digest->new().

Why: The existing test suite had 23 tests across 4 files — solid for basic functionality but thin on the dispatch logic that is the module's primary responsibility. The MMAP lookup, fallback chains, AUTOLOAD sugar, and error handling were largely untested.

How: Uses in-memory mock packages (Digest::MockA, Digest::MockB) to test dispatch without requiring external digest modules. Tests cover:

  • MMAP lookup: plain string, arrayref with args, fallback chains
  • AUTOLOAD dispatch (Digest->MockB(...) sugar)
  • Non-word character stripping for unmapped algorithms
  • Error propagation (first error preserved when all implementations fail)
  • $@ preservation for callers
  • Argument passthrough (MMAP args + user args)
  • Real file-based require (using existing Digest::Dummy)

Testing: make test passes — 39 tests across 5 files (was 23/4).

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 191 insertions(+)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Add t/dispatch.t with 16 tests covering Digest->new() dispatch logic:
MMAP lookup (string, arrayref, fallback chains), AUTOLOAD sugar,
non-word character stripping, error propagation, $@ preservation,
and argument passthrough. Total test count: 23 → 39.

Add CLAUDE.md with project conventions for AI-assisted development.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant