X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=blobdiff_plain;f=t%2F23-branch.t;h=2f97ea8d604eed9f7591975ba6e9cf62d9ef40e3;hp=8aced0dca51e33f26e27fb8a9d98b5da2fd8735e;hb=3ad0dc082fd7c56afdc76066a7f8c94c4ae28e69;hpb=abeae39be61a1284ff7551d1d669e0b458e264e8 diff --git a/t/23-branch.t b/t/23-branch.t index 8aced0d..2f97ea8 100644 --- a/t/23-branch.t +++ b/t/23-branch.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 16; +use Test::More tests => 17; use Sub::Nary; @@ -44,7 +44,7 @@ sub ret1234 { } } -sub retinif { +sub retinif1 { if (return 1, 2) { return 1, 2, 3 } else { @@ -52,6 +52,12 @@ sub retinif { } } +sub retinif2 { + if (do { return 2, 3 if $x }) { + return 4, 5, 6; + } +} + my @tests = ( [ \&ret12, { 1 => 0.5, 2 => 0.5 } ], [ \&ret12b, { 1 => 0.5, 2 => 0.5 } ], @@ -73,7 +79,8 @@ my @tests = ( [ \&ret1234, { 2 => 0.5, 3 => 0.25, 4 => 0.125, 1 => 0.125 } ], - [ \&retinif, { 2 => 1 } ], + [ \&retinif1, { 2 => 1 } ], + [ \&retinif2, { 2 => 0.5, 3 => 0.25, 1 => 0.25 } ], ); my $i = 1;