X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-return.t;fp=t%2F20-return.t;h=ccfd9e9fa2a0aaf8df73a912e5bb54677899507f;hb=f73405816c83f0e2816e81421a8b6cf72d5e3151;hp=c48eeeff15c3bef5c82b140f0031fe94b58b2b5b;hpb=3ad0dc082fd7c56afdc76066a7f8c94c4ae28e69;p=perl%2Fmodules%2FSub-Nary.git diff --git a/t/20-return.t b/t/20-return.t index c48eeef..ccfd9e9 100644 --- a/t/20-return.t +++ b/t/20-return.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 76; +use Test::More tests => 79; use Sub::Nary; @@ -25,6 +25,10 @@ my @tests = ( [ sub { do { 1; return 2, 3 } }, 2 ], [ sub { do { 1; return 2, 3; 4 } }, 2 ], [ sub { do { 1; return 2, return 3 } }, 1 ], + [ sub { do { return if $x; 2, 3 }, 4 }, { 0 => 0.5, 3 => 0.5 } ], + [ sub { do { do { return if $x }, 3 }, 4 }, { 0 => 0.5, 3 => 0.5 } ], + [ sub { do { return if $x; 2, 3 }, do { return 1 if $y; 4, 5, 6 } }, + { 0 => 0.5, 1 => 0.25, 5 => 0.25 } ], [ sub { return $x }, 1 ], [ sub { return $x, $y }, 2 ],