Switching to `` requires one more \ to escape $Config in new_config=`...`
[p5sagit/p5-mst-13.2.git] / t / lib / autodie / open.t
CommitLineData
0b09a93a 1#!/usr/bin/perl -w
2use strict;
3
4use Test::More 'no_plan';
5
6use constant NO_SUCH_FILE => "this_file_had_better_not_exist";
7
8use autodie;
9
10eval { open(my $fh, '<', NO_SUCH_FILE); };
11ok($@, "3-arg opening non-existent file fails");
12like($@, qr/for reading/, "Well-formatted 3-arg open failure");
13
14eval { open(my $fh, "< ".NO_SUCH_FILE) };
15ok($@, "2-arg opening non-existent file fails");
16
17like($@, qr/for reading/, "Well-formatted 2-arg open failure");
18unlike($@, qr/GLOB\(0x/, "No ugly globs in 2-arg open messsage");