cpan/autodie/t/repeat.t
raw| 1 | #!/usr/bin/perl -w |
| 2 | use strict; |
| 3 | use Test::More 'no_plan'; |
| 4 | use constant NO_SUCH_FILE => "this_file_had_better_not_exist"; |
| 5 | |
| 6 | eval { |
| 7 | use autodie qw(open open open); |
| 8 | open(my $fh, '<', NO_SUCH_FILE); |
| 9 | }; |
| 10 | |
| 11 | isa_ok($@,q{autodie::exception}); |
| 12 | ok($@->matches('open'),"Exception from open"); |
| 13 | |
| 14 | eval { |
| 15 | open(my $fh, '<', NO_SUCH_FILE); |
| 16 | }; |
| 17 | |
| 18 | is($@,"","Repeated autodie should not leak"); |
| 19 |