# New Ticket Created by "Kyle Hasselbacher" # Please include the string: [perl #67622] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67622 >
Sometimes something dies, as it should, but with the wrong error. The best way to test this is to specify the correct error, but we don't always have the correct error. This patch makes dies_ok reject a particular Rakudo-specific error that is always incorrect. Kyle.
>From 8eb6fc78316e686bec5749b6e3baae1b86d56375 Mon Sep 17 00:00:00 2001 From: Kyle Hasselbacher <k...@livetext.com> Date: Wed, 15 Jul 2009 12:40:05 -0500 Subject: [PATCH] [Test.pm] dies_ok should not be ok when death is from "Null PMC access" [Test.pm] eval_dies_ok should also not accept "Null PMC access" --- Test.pm | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Test.pm b/Test.pm index 0f90a16..3770d73 100644 --- a/Test.pm +++ b/Test.pm @@ -123,7 +123,7 @@ multi sub dies_ok(Callable $closure, $reason) is export(:DEFAULT) { try { $closure(); } - proclaim((defined $!), $reason); + proclaim((defined $! && "$!" !~~ / ^ 'Null PMC access ' /), $reason); } multi sub dies_ok(Callable $closure) is export(:DEFAULT) { dies_ok($closure, ''); @@ -140,7 +140,8 @@ multi sub lives_ok(Callable $closure) is export(:DEFAULT) { } multi sub eval_dies_ok(Str $code, $reason) is export(:DEFAULT) { - proclaim((defined eval_exception($code)), $reason); + my $ee = eval_exception($code); + proclaim((defined $ee && "$ee" !~~ / ^ 'Null PMC access' /), $reason); } multi sub eval_dies_ok(Str $code) is export(:DEFAULT) { eval_dies_ok($code, ''); -- 1.6.0.4