From: Rafael Garcia-Suarez Date: Thu, 11 Feb 2010 21:36:54 +0000 (+0100) Subject: Silence spurious warning in new Safe test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fda8057a23c2a6466f12faa1ddd013fc06986db3;p=p5sagit%2Fp5-mst-13.2.git 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. --- 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; +}