use Test::More tests => 26;
-BEGIN { use_ok 'Try::Tiny' };
+use Try::Tiny;
sub _eval {
local $@;
use Test::More;
-BEGIN {
- plan tests =>
- 1 # use_ok
- + (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply
- + 4 # void with exception
- + (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply
- + 3 # void no exception
- ;
+use Try::Tiny;
- use_ok 'Try::Tiny';
-}
+plan tests =>
+ (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply
++ 4 # void with exception
++ (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply
++ 3 # void no exception
+;
my $ctx_index = {
VOID => undef,
use warnings;
use Test::More tests => 6;
+
use Try::Tiny;
sub _eval {
use Test::More tests => 28;
-BEGIN { use_ok 'Try::Tiny' };
+use Try::Tiny;
try {
my $a = 1+1;
BEGIN {
plan skip_all => "Perl 5.10 is required" unless eval { require 5.010 };
plan tests => 3;
- use_ok("Try::Tiny");
}
+use Try::Tiny;
+
use 5.010;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
plan tests => 6;
}
-
-BEGIN { use_ok 'Try::Tiny' }
+use Try::Tiny;
use 5.010;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';