summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/t/lib/fatal.t
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-04-29 22:36:41 +0000
committermillert <millert@openbsd.org>1999-04-29 22:36:41 +0000
commit0a5f61bb653fdff7c29c2275df78c7f019a04c0c (patch)
tree0b6e610f8913b7c1e30fd7bf5bfc62edcbbd93e5 /gnu/usr.bin/perl/t/lib/fatal.t
parentY2K fix: allow 'shutdown yymmddhhmm' to work in the next century. (diff)
downloadwireguard-openbsd-0a5f61bb653fdff7c29c2275df78c7f019a04c0c.tar.xz
wireguard-openbsd-0a5f61bb653fdff7c29c2275df78c7f019a04c0c.zip
perl5.005_03
Diffstat (limited to 'gnu/usr.bin/perl/t/lib/fatal.t')
-rw-r--r--gnu/usr.bin/perl/t/lib/fatal.t27
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;
+}