diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-04-29 22:42:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-04-29 22:42:18 +0000 |
commit | 37583d269f066aa8aa04ea18126b188d12257e6d (patch) | |
tree | bba3141cc21b941e00df1c922f6b91f28d81a28a /gnu/usr.bin/perl/t/lib/fatal.t | |
parent | d8fdfa5c3dd1aecb5a53cab412e78ab3b5c9833c (diff) |
perl5.005_03
Diffstat (limited to 'gnu/usr.bin/perl/t/lib/fatal.t')
-rw-r--r-- | gnu/usr.bin/perl/t/lib/fatal.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/t/lib/fatal.t b/gnu/usr.bin/perl/t/lib/fatal.t new file mode 100644 index 00000000000..fb3757f5cda --- /dev/null +++ b/gnu/usr.bin/perl/t/lib/fatal.t @@ -0,0 +1,27 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; + print "1..9\n"; +} + +use strict; +use Fatal qw(open); + +my $i = 1; +eval { open FOO, '<lkjqweriuapofukndajsdlfjnvcvn' }; +print "not " unless $@ =~ /^Can't open/; +print "ok $i\n"; ++$i; + +my $foo = 'FOO'; +for ('$foo', "'$foo'", "*$foo", "\\*$foo") { + eval qq{ open $_, '<$0' }; + print "not " if $@; + print "ok $i\n"; ++$i; + + print "not " unless scalar(<FOO>) =~ m|^#!./perl|; + print "not " if $@; + print "ok $i\n"; ++$i; + close FOO; +} |