| 1 |
#!/usr/bin/perl -w |
| 2 |
use strict; |
| 3 |
use Fatal qw(open); |
| 4 |
use Test::More tests => 2; |
| 5 |
use constant NO_SUCH_FILE => "xyzzy_this_file_is_not_here"; |
| 6 |
|
| 7 |
eval { |
| 8 |
open(my $fh, '<', NO_SUCH_FILE); |
| 9 |
}; |
| 10 |
|
| 11 |
my $old_msg = qr{Can't open\(GLOB\(0x[0-9a-f]+\), <, xyzzy_this_file_is_not_here\): .* at \(eval \d+\)(?:\[.*?\])? line \d+\.?\s+main::__ANON__\('?GLOB\(0x[0-9a-f]+\)'?,\s*['"]<['"],\s*['"]xyzzy_this_file_is_not_here['"]\) called at \S+ line \d+\s+eval \Q{...}\E called at \S+ line \d+}; |
| 12 |
|
| 13 |
like($@,$old_msg,"Backwards compat ugly messages"); |
| 14 |
is(ref($@),"", "Exception is a string, not an object"); |