This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bring '*' prototype closer to how it behaves internally
[perl5.git] / t / lib / fatal.t
CommitLineData
2ba6ecf4
GS
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
5 unshift @INC, '../lib';
6 print "1..9\n";
7}
8
9use strict;
10use Fatal qw(open);
11
12my $i = 1;
13eval { open FOO, '<lkjqweriuapofukndajsdlfjnvcvn' };
14print "not " unless $@ =~ /^Can't open/;
15print "ok $i\n"; ++$i;
16
17my $foo = 'FOO';
18for ('$foo', "'$foo'", "*$foo", "\\*$foo") {
19 eval qq{ open $_, '<$0' };
20 print "not " if $@;
21 print "ok $i\n"; ++$i;
22
23 print "not " unless scalar(<FOO>) =~ m|^#!./perl|;
24 print "not " if $@;
25 print "ok $i\n"; ++$i;
26 close FOO;
27}