This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
git-flavoured autodie 1.997 patch
[perl5.git] / t / lib / autodie / backcompat.t
CommitLineData
0b09a93a
PF
1#!/usr/bin/perl -w
2use strict;
3use Fatal qw(open);
4use Test::More tests => 2;
5use constant NO_SUCH_FILE => "xyzzy_this_file_is_not_here";
6
7eval {
8 open(my $fh, '<', NO_SUCH_FILE);
9};
10
11my $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
13like($@,$old_msg,"Backwards compat ugly messages");
14is(ref($@),"", "Exception is a string, not an object");