]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/55-yield-target.t
t/ - Given is deprecated in 5.37.10, do not test it
[perl/modules/Scope-Upper.git] / t / 55-yield-target.t
index 46ea7f5d51e44287355cb7d3aea7dd0c290e5a60..682d4cc9758b6a6b80f90e6c677e815217bc7b61 100644 (file)
@@ -63,7 +63,9 @@ is_deeply \@res, [ 15, 19 ], 'yield() in for () { ... }';
 is $loop, 21, 'yield() exited while';
 is_deeply \@res, [ 20, 23 ], 'yield() in while () { ... }';
 
-{
+SKIP: {
+ skip '"eval { $str =~ s/./die q[foo]/e }" breaks havoc on perl 5.8 and below'
+                                                           => 1 if "$]" < 5.010;
  my $s = 'a';
  local $@;
  eval {
@@ -79,8 +81,16 @@ is_deeply \@res, [ 20, 23 ], 'yield() in while () { ... }';
 SKIP: {
  skip 'perl 5.10 is required to test interaction with given/when' => 6
                                                                 if "$]" < 5.010;
+ skip 'Not testing deprecated given/when on Perl 5.37.10 or later'
+      => 6 if "$]" >= 5.037010;
 
  @res = eval <<'TESTCASE';
+  BEGIN {
+   if ("$]" >= 5.017_011) {
+    require warnings;
+    warnings->unimport('experimental::smartmatch');
+   }
+  }
   use feature 'switch';
   (24, do {
    given (25) {
@@ -96,6 +106,12 @@ TESTCASE
  # end of the enclosing given block.
  @res = ();
  eval <<'TESTCASE';
+  BEGIN {
+   if ("$]" >= 5.017_011) {
+    require warnings;
+    warnings->unimport('experimental::smartmatch');
+   }
+  }
   use feature 'switch';
   @res = (28, do {
    given (29) {
@@ -113,6 +129,12 @@ TESTCASE
  # But calling yield() in when() in for() sends us at the next iteration.
  @res = ();
  eval <<'TESTCASE';
+  BEGIN {
+   if ("$]" >= 5.017_011) {
+    require warnings;
+    warnings->unimport('experimental::smartmatch');
+   }
+  }
   use feature 'switch';
   @res = (31, do {
    for (32, 33) {