X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=blobdiff_plain;f=t%2F23-branch.t;h=e2638f76bc246b62d23623bc4177b6a54819ced9;hp=2f97ea8d604eed9f7591975ba6e9cf62d9ef40e3;hb=8830bd5a774a9d459a6c843b7dbc177c13f753fc;hpb=efc5762598689b6ee22dfc8ad29f4e8a22457c0a diff --git a/t/23-branch.t b/t/23-branch.t index 2f97ea8..e2638f7 100644 --- a/t/23-branch.t +++ b/t/23-branch.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 17; +use Test::More tests => 21 + ($^V ge v5.10.0 ? 1 : 0); use Sub::Nary; @@ -81,6 +81,12 @@ my @tests = ( [ \&retinif1, { 2 => 1 } ], [ \&retinif2, { 2 => 0.5, 3 => 0.25, 1 => 0.25 } ], + + [ sub { $x || (3, 4) }, { 1 => 0.5, 2 => 0.5 } ], + [ sub { $x or (3, 4) }, { 1 => 0.5, 2 => 0.5 } ], + [ sub { $x && (3, 4) }, { 1 => 0.5, 2 => 0.5 } ], + [ sub { $x and (3, 4) }, { 1 => 0.5, 2 => 0.5 } ], + (([ eval 'sub { $x // (3, 4) }', { 1 => 0.5, 2 => 0.5 } ]) x ($^V ge v5.10.0)), ); my $i = 1;