File: no-all.t

package info (click to toggle)
libautodie-perl 2.29-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 764 kB
  • ctags: 299
  • sloc: perl: 3,856; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

package foo;
use warnings;
use strict;
use Test::More tests => 1;
use autodie qw(:all);

use_system();
ok("system() works with a lexical 'no autodie' block (github issue #69");

sub break_system {
    no autodie;
    open(my $fh, "<", 'NONEXISTENT');
    ok("survived failing open");
}

sub use_system {
    system($^X, '-e' , 1);
}

1;