diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-02-11 22:36:54 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-02-11 22:36:54 +0100 |
commit | fda8057a23c2a6466f12faa1ddd013fc06986db3 (patch) | |
tree | c285206333dcf4a031f84f150290e6c95b48925b /dist/Safe | |
parent | abb363a146c0f4d5955aff0db0ef4e60a66e50ed (diff) | |
download | perl-fda8057a23c2a6466f12faa1ddd013fc06986db3.tar.gz |
Silence spurious warning in new Safe test
This warning is emitted by perl when re-throwing the exception, so add a
TODO test to suppress it. However, fixing that will imply a core change.
Diffstat (limited to 'dist/Safe')
-rw-r--r-- | dist/Safe/t/safesort.t | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dist/Safe/t/safesort.t b/dist/Safe/t/safesort.t index 71d9a94fde..01bed36182 100644 --- a/dist/Safe/t/safesort.t +++ b/dist/Safe/t/safesort.t @@ -9,7 +9,7 @@ BEGIN { } use Safe 1.00; -use Test::More tests => 9; +use Test::More tests => 10; my $safe = Safe->new('PLPerl'); $safe->permit_only(qw(:default sort)); @@ -46,6 +46,11 @@ $@ = 42; $die_func->(); is $@, 42, 'successful closure call should not alter $@'; -ok !eval { $die_func->("died\n"); 1 }, 'should die'; -is $@, "died\n", '$@ should be set correctly'; - +{ + my $warns = 0; + local $SIG{__WARN__} = sub { $warns++ }; + ok !eval { $die_func->("died\n"); 1 }, 'should die'; + is $@, "died\n", '$@ should be set correctly'; + local $TODO = "Shouldn't warn"; + is $warns, 0; +} |