2
use Test::More 'no_plan';
6
open *STDERR, '>', \$STDERR;
11
ok length $STDERR == 0 => 'True insist is silent';
13
$ASSERTION = << 'END_ASSERT';
15
# $x < 0 was not true at FILE line 22.
19
$ASSERTION =~ s/#/###/g;
25
ok $@ => 'False insist is deadly';
26
ok $@ eq "\n" => 'False insist is deadly silent';
28
$STDERR =~ s/ at \S+ line / at FILE line /;
30
ok length $STDERR != 0 => 'False insist is loud';
31
is $STDERR, $ASSERTION => 'False insist is loudly correct';
35
open *STDERR, '>', \$STDERR;
40
my $ASSERTION2 = << 'END_ASSERTION2';
42
# $y < $x was not true at FILE line 50.
47
$ASSERTION2 =~ s/#/###/g;
53
ok $@ => 'False two-part insist is deadly';
54
ok $@ eq "\n" => 'False two-part insist is deadly silent';
56
$STDERR =~ s/ at \S+ line / at FILE line /;
58
ok length $STDERR != 0 => 'False two-part insist is loud';
59
is $STDERR, $ASSERTION2 => 'False two-part insist is loudly correct';