autodie
view release on metacpan or search on metacpan
t/core-trampoline-slurp.t view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 3;
# Tests for GH #22
#
# Slurpy calls (like open, unlink, chown, etc) could not be
# interpreted properly if they leak into another file which
# doesn't have autodie enabled.
use autodie;
use FindBin qw($Bin);
use lib $Bin;
use autodie_test_module;
# This will throw an error, but it shouldn't throw a leak-guard
# failure.
eval { slurp_leak_open(); };
unlike($@,qr/Leak-guard failure/, "Leak guard failure (open)");
eval { slurp_leak_unlink(); };
is($@,"","No error should be thrown by leaked guards (unlink)");
unlike($@,qr/Leak-guard failure/, "Leak guard failure (unlink)");
( run in 1.641 second using v1.01-cache-2.11-cpan-8dfa8b56332 )