Skip to content

fix: suppress Subroutine redefined warnings in test suite#50

Merged
toddr merged 1 commit intocpan-authors:mainfrom
toddr-bot:koan.toddr.bot/fix-issue-48
Mar 18, 2026
Merged

fix: suppress Subroutine redefined warnings in test suite#50
toddr merged 1 commit intocpan-authors:mainfrom
toddr-bot:koan.toddr.bot/fix-issue-48

Conversation

@toddr-bot
Copy link
Collaborator

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

Summary

MockJabberClient.pm declares package Net::Jabber::Client then use Net::Jabber, which loads the real module's RosterDB and RosterRequest subs. When the mock re-declares these stubs, Perl emits "Subroutine redefined" warnings on every test file that uses the mock.

Added no warnings 'redefine' before the intentional stub overrides.

Fixes #48

Changes

  • Add no warnings 'redefine' in t/lib/MockJabberClient.pm before RosterDB and RosterRequest stub definitions

Test plan

  • make test passes with no "Subroutine redefined" warnings in output
  • All 301 tests pass

Generated by Kōan /fix


Quality Report

Changes: 1 file changed, 2 insertions(+)

Code scan: clean

Tests: failed (timeout (120s))

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

MockJabberClient.pm declares package Net::Jabber::Client then loads
Net::Jabber (which defines the real RosterDB and RosterRequest subs).
When the mock re-declares these stubs, Perl emits redefinition warnings.

Add 'no warnings "redefine"' before the intentional overrides.

Fixes cpan-authors#48

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review March 18, 2026 20:50
@toddr toddr merged commit a7258c4 into cpan-authors:main Mar 18, 2026
17 checks passed
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.

Fix test suite re-defined

2 participants