OS Manuals

Test2::Warnings(3pm)

Test2::Warnings(3) User Contributed Perl Documentation Test2::Warnings(3)

    use Test2::V0;
    use Test::Warnings;
    pass('yay!');
    done_testing;

emits TAP:

    ok 1 - yay!
    ok 2 - no (unexpected) warnings (via done_testing)
    1..2

and:

    use Test::More tests => 3;
    use Test::Warnings 0.005 ':all';
    pass('yay!');
    like(warning { warn "oh noes!" }, qr/^oh noes/, 'we warned');

emits TAP:

    ok 1 - yay!
    ok 2 - we warned
    ok 3 - no (unexpected) warnings (via END block)
    1..3

See Test::Warnings for full documentation.

For now, this is a simple wrapper around Test::Warnings, but there is a plan to make this a full port and eject all the old Test::Builder compatibility and use the Test2 suite correctly.

2026-10-26 perl v5.44.0

perl-test-warnings 0.038-r4 · os · ingested 2026-10-27