]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/23-branch.t
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/Sub-Nary.git] / t / 23-branch.t
index 2f97ea8d604eed9f7591975ba6e9cf62d9ef40e3..fef709dc1da61c42bddf566e42d0ca974b4c924e 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 17;
+use Test::More tests => 21 + ("$]" >= 5.010 ? 1 : 0);
 
 use Sub::Nary;
 
@@ -40,7 +40,7 @@ sub ret1234 {
  } elsif ($h{foo}) {
   return 3, @a[4, 5];
  } elsif (@a) {
-  return @h{qw/a b c/}, $y
+  return @h{qw<a b c>}, $y
  }
 }
 
@@ -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 ("$]" >= 5.010)),
 );
 
 my $i = 1;