0 $ ˆl–ßi~””ÔD¨ ¥íÀãO)‹FÿÁ „ o6ÿÀÄÆ=ó .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::Warnings 3" .TH Test::Warnings 3 "2024-01-23" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Warnings \- Test for warnings and the lack of them .SH "VERSION" .IX Header "VERSION" version 0.033 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Test::More; \& use Test::Warnings; \& \& pass(\*(Aqyay!\*(Aq); \& done_testing; .Ve .PP emits \s-1TAP:\s0 .PP .Vb 3 \& ok 1 \- yay! \& ok 2 \- no (unexpected) warnings (via done_testing) \& 1..2 .Ve .PP and: .PP .Vb 2 \& use Test::More tests => 3; \& use Test::Warnings 0.005 \*(Aq:all\*(Aq; \& \& pass(\*(Aqyay!\*(Aq); \& like(warning { warn "oh noes!" }, qr/^oh noes/, \*(Aqwe warned\*(Aq); .Ve .PP emits \s-1TAP:\s0 .PP .Vb 4 \& ok 1 \- yay! \& ok 2 \- we warned \& ok 3 \- no (unexpected) warnings (via END block) \& 1..3 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" If you've ever tried to use Test::NoWarnings to confirm there are no warnings generated by your tests, combined with the convenience of \f(CW\*(C`done_testing\*(C'\fR to not have to declare a test count, you'll have discovered that these two features do not play well together, as the test count will be calculated \fIbefore\fR the warnings test is run, resulting in a \s-1TAP\s0 error. (See \f(CW\*(C`examples/test_nowarnings.pl\*(C'\fR in this distribution for a demonstration.) .PP This module is intended to be used as a drop-in replacement for Test::NoWarnings: it also adds an extra test, but runs this test \fIbefore\fR \&\f(CW\*(C`done_testing\*(C'\fR calculates the test count, rather than after. It does this by hooking into \f(CW\*(C`done_testing\*(C'\fR as well as via an \f(CW\*(C`END\*(C'\fR block. You can declare a plan, or not, and things will still Just Work. .PP It is actually equivalent to: .PP .Vb 1 \& use Test::NoWarnings 1.04 \*(Aq:early\*(Aq; .Ve .PP as warnings are still printed normally as they occur. You are saf