diff options
Diffstat (limited to 't/lib/fatal.t')
-rwxr-xr-x | t/lib/fatal.t | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/t/lib/fatal.t b/t/lib/fatal.t index fb3757f5cd..019265899a 100755 --- a/t/lib/fatal.t +++ b/t/lib/fatal.t @@ -3,11 +3,11 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; - print "1..9\n"; + print "1..13\n"; } use strict; -use Fatal qw(open); +use Fatal qw(open close); my $i = 1; eval { open FOO, '<lkjqweriuapofukndajsdlfjnvcvn' }; @@ -20,8 +20,9 @@ for ('$foo', "'$foo'", "*$foo", "\\*$foo") { print "not " if $@; print "ok $i\n"; ++$i; - print "not " unless scalar(<FOO>) =~ m|^#!./perl|; + print "not " if $@ or scalar(<$foo>) !~ m|^#!./perl|; + print "ok $i\n"; ++$i; + eval qq{ close FOO }; print "not " if $@; print "ok $i\n"; ++$i; - close FOO; } |