Deprecate shellwords.pl with a warning
[p5sagit/p5-mst-13.2.git] / lib / autodie / t / sysopen.t
CommitLineData
0b09a93a 1#!/usr/bin/perl -w
2use strict;
3use Test::More 'no_plan';
4use Fcntl;
5
6use autodie qw(sysopen);
7
8use constant NO_SUCH_FILE => "this_file_had_better_not_be_here_at_all";
9
10my $fh;
11eval {
12 sysopen($fh, $0, O_RDONLY);
13};
14
15is($@, "", "sysopen can open files that exist");
16
17like(scalar( <$fh> ), qr/perl/, "Data in file read");
18
19eval {
20 sysopen(my $fh2, NO_SUCH_FILE, O_RDONLY);
21};
22
23isa_ok($@, 'autodie::exception', 'Opening a bad file fails with sysopen');