File: synopsis_2.t

package info (click to toggle)
libtest-warnings-perl 0.038-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 472 kB
  • sloc: perl: 375; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 331 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
use warnings;

# this test demonstrates that we can capture warnings and test its contents,
# and that captured warning will not fail the had-no-warnings test which is
# added at the end

use Test::More tests => 3;
use Test::Warnings ':all';

pass('yay!');
like(warning { warn "oh noes!" }, qr/^oh noes/, 'we warned');