Skip to content

fix: use done_testing() without explicit test count#58

Draft
toddr-bot wants to merge 1 commit intoTux:masterfrom
toddr-bot:koan.toddr.bot/fix-issue-53
Draft

fix: use done_testing() without explicit test count#58
toddr-bot wants to merge 1 commit intoTux:masterfrom
toddr-bot:koan.toddr.bot/fix-issue-53

Conversation

@toddr-bot
Copy link
Copy Markdown

@toddr-bot toddr-bot commented Mar 21, 2026

Summary

Test::NoWarnings can add an extra test at END time, causing "planned N tests but ran N+1" failures when done_testing($count) is used with an explicit count. This happens when optional parser modules are missing and tests are skipped, but Test::NoWarnings still runs its check.

Replaces done_testing($tests) with done_testing() across all test files, removing the now-unnecessary $tests counter variables and their manual increments.

Fixes #53

Changes

  • Replace done_testing($tests) and done_testing(N) with done_testing() in 64 test files
  • Remove my $tests = N; declarations that are no longer needed
  • Remove $tests++ / $tests += N / $tests -= N increments that tracked the count
  • Preserve $notyet variable in t/410_ods.t (still used for conditional test execution)

Test plan

  • Ran full test suite with prove -b t/ — all tests pass (the only failure is a pre-existing issue in t/37_merged.t unrelated to this change)
  • Verified the four originally reported failing tests (t/426_clr.t, t/50_sc.t, t/51_sc.t, t/999_fail.t) now pass cleanly

Generated by Kōan /fix


Quality Report

Changes: 64 files changed, 63 insertions(+), 185 deletions(-)

Code scan: clean

Tests: failed (43 Failed, 1 test)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Test::NoWarnings can add an extra test at END time, causing
"planned N tests but ran N+1" failures when done_testing($count)
is used. This happens when optional parser modules are missing and
tests are skipped but Test::NoWarnings still runs its check.

Replace done_testing($tests) with done_testing() across all test
files, removing the now-unnecessary $tests counter variables and
their manual increments.

Fixes Tux#53

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.

test count wrong on 0.91 when missing modules?

1 participant