Skip to content

test: add 70 tests for Agent.pm#51

Merged
toddr merged 2 commits into
mainfrom
koan.toddr.bot/add-agent-tests
May 26, 2026
Merged

test: add 70 tests for Agent.pm#51
toddr merged 2 commits into
mainfrom
koan.toddr.bot/add-agent-tests

Conversation

@toddr-bot

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

Copy link
Copy Markdown
Contributor

What

First test coverage for Agent.pm — 70 tests covering the module's testable surface without network access.

Why

Agent.pm is the main entry point (constructor, mbox parsing, whitelist, local checks) yet had zero test coverage. These tests lock down behavior for the pure-logic paths.

How

  • Constructor validation for all 4 breeds + invalid input + full-path extraction
  • parse_mbox: RFC822, mbox splitting, >From quoting, aref/fh input, empty files
  • local_check: List-Id detection (with/without ignorelist), folded headers
  • read_whitelist: file parsing, key lowercasing, regex patterns, caching
  • _help text for all breeds, log/logll with and without logref
  • MANIFEST.SKIP updated to exclude build artifacts (.o, .bs, generated .c)

Testing

make test
# 252 tests, all pass (70 new in t/agent.t)

🤖 Generated with Claude Code


Quality Report

Changes: 3 files changed, 536 insertions(+)

Code scan: 1 issue(s) found

  • t/agent.t:0 — 532 lines added

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

toddr-bot and others added 2 commits April 7, 2026 04:24
…local_check)

Agent.pm had zero test coverage despite being the main entry point.
These tests cover the testable surface without requiring network access:
- Constructor validation for all 4 breeds plus invalid input
- parse_mbox: single RFC822, mbox splitting, >From quoting, aref/fh input
- local_check: mailing-list detection, whitelist matching, regex patterns
- read_whitelist: file parsing, key lowercasing, caching behavior
- _help text generation for all breeds
- log/logll behavior with and without logref

Also fix MANIFEST.SKIP to exclude build artifacts (.o, .bs, generated .c).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review May 20, 2026 07:31
@toddr toddr added the Smoke label May 20, 2026
@toddr toddr merged commit e28825d into main May 26, 2026
24 checks passed
@toddr toddr deleted the koan.toddr.bot/add-agent-tests branch May 26, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants