X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=blobdiff_plain;f=t%2F22-call.t;h=f6fe4e6faa623eff7e13a43674a7cdc43e7461b2;hp=6aa786333a1bebd54980c6a27c63267796510e74;hb=HEAD;hpb=3271ef4bff5871bc6aa2d90537f97f177cbacc2a diff --git a/t/22-call.t b/t/22-call.t index 6aa7863..f6fe4e6 100644 --- a/t/22-call.t +++ b/t/22-call.t @@ -3,12 +3,14 @@ use strict; use warnings; -use Test::More tests => 42; +use Test::More tests => 43; use Sub::Nary; my $sn = Sub::Nary->new(); +my $x; + sub CORE::GLOBAL::reset { return 1, 2, 3 } @@ -38,8 +40,9 @@ my @tests = ( [ sub { do { one, do { two } } }, 3 ], [ sub { do { lots, do { one } } }, 'list' ], - [ sub { 1, return two, do { 4 } }, 3 ], - [ sub { two 1, return 2 }, 1 ], + [ sub { 1, return two, do { 4 } }, 3 ], + [ sub { two 1, return 2 }, 1 ], + [ sub { two 1, do { return 5 if $x; 3 } }, { 1 => 0.5, 2 => 0.5 } ], [ sub { 1, one(), 2 }, 3 ], [ sub { 1, one(), @_ }, 'list' ],