| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
use Test::More tests => 3; |
| 5 |
|
| 6 |
# Tests for GH #22 |
| 7 |
# |
| 8 |
# Slurpy calls (like open, unlink, chown, etc) could not be |
| 9 |
# interpreted properly if they leak into another file which |
| 10 |
# doesn't have autodie enabled. |
| 11 |
|
| 12 |
use autodie; |
| 13 |
use FindBin qw($Bin); |
| 14 |
use lib $Bin; |
| 15 |
use autodie_test_module; |
| 16 |
|
| 17 |
# This will throw an error, but it shouldn't throw a leak-guard |
| 18 |
# failure. |
| 19 |
eval { slurp_leak_open(); }; |
| 20 |
unlike($@,qr/Leak-guard failure/, "Leak guard failure (open)"); |
| 21 |
|
| 22 |
eval { slurp_leak_unlink(); }; |
| 23 |
is($@,"","No error should be thrown by leaked guards (unlink)"); |
| 24 |
unlike($@,qr/Leak-guard failure/, "Leak guard failure (unlink)"); |