From fda8057a23c2a6466f12faa1ddd013fc06986db3 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 11 Feb 2010 22:36:54 +0100 Subject: [PATCH] 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. --- dist/Safe/t/safesort.t | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dist/Safe/t/safesort.t b/dist/Safe/t/safesort.t index 71d9a94..01bed36 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; +} -- 2.7.4