]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/lib/Scope/Upper/TestGenerator.pm
Fix handling of given/when
[perl/modules/Scope-Upper.git] / t / lib / Scope / Upper / TestGenerator.pm
index af267870189e2a2f629a12d89c42266b8e6f3839..99764d5618f3fad75c3198f9206d31d0c065b36c 100644 (file)
@@ -25,6 +25,14 @@ my @blocks = (
  [ 'eval q[',   '];' ],
 );
 
+sub import {
+ if ($] >= 5.010001) {
+  push @blocks, [ 'given (1) { my $_;', '}' ];
+  require feature;
+  feature->import('switch');
+ }
+}
+
 @blocks = map [ map "$_\n", @$_ ], @blocks;
 
 sub _block {