From: Mark Fowler Date: Fri, 5 Jul 2013 19:06:03 +0000 (-0400) Subject: tests for finally name too X-Git-Tag: Try-Tiny-0.15~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ada8284ba56d43e13de84a735ca4d9d42f498e6d;p=p5sagit%2FTry-Tiny.git tests for finally name too --- diff --git a/t/named.t b/t/named.t index d8a4d95..403adc1 100644 --- a/t/named.t +++ b/t/named.t @@ -8,7 +8,7 @@ use Test::More; BEGIN { plan skip_all => "Sub::Name required" unless eval { require Sub::Name; 1 }; - plan tests => 3; + plan tests => 4; } BEGIN { use_ok 'Try::Tiny' } @@ -26,3 +26,12 @@ try { }; is $name, "main::catch {...} ", "catch name"; # note extra space +try { + die "Boom"; +} catch { + # noop +} finally { + $name = (caller(0))[3]; +}; +is $name, "main::finally {...} ", "finally name"; # note extra space +