]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/56-unwind-context.t
Switch to qw<>
[perl/modules/Scope-Upper.git] / t / 56-unwind-context.t
index 29733645b8ed552982237e1cc4b0b615362bcfd7..2779c9d50d2a4c69f066e06a8f52422eeb85473e 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 
 use Test::More tests => 33;
 
-use Scope::Upper qw/unwind SUB/;
+use Scope::Upper qw<unwind SUB>;
 
 my ($res, @res);
 
@@ -13,7 +13,7 @@ my ($res, @res);
 
 sub {
  $res = 1;
- unwind(qw/a b c/ => SUB);
+ unwind(qw<a b c> => SUB);
  $res = 0;
 }->(0);
 ok $res, 'unwind in void context at sub to void';
@@ -21,7 +21,7 @@ ok $res, 'unwind in void context at sub to void';
 sub {
  $res = 1;
  eval {
-  unwind(qw/d e f/ => SUB);
+  unwind(qw<d e f> => SUB);
  };
  $res = 0;
 }->(0);
@@ -30,7 +30,7 @@ ok $res, 'unwind in void context at sub across eval to void';
 sub {
  $res = 1;
  for (1 .. 5) {
-  unwind qw/g h i/ => SUB;
+  unwind qw<g h i> => SUB;
  }
  $res = 0;
 }->(0);
@@ -39,14 +39,14 @@ ok $res, 'unwind in void context at sub across loop to void';
 # --- Void to scalar ----------------------------------------------------------
 
 $res = sub {
- unwind(qw/a b c/ => SUB);
+ unwind(qw<a b c> => SUB);
  return 'XXX';
 }->(0);
 is $res, 'c', 'unwind in void context at sub to scalar';
 
 $res = sub {
  eval {
-  unwind qw/d e f/ => SUB;
+  unwind qw<d e f> => SUB;
  };
  return 'XXX';
 }->(0);
@@ -54,13 +54,13 @@ is $res, 'f', 'unwind in void context at sub across eval to scalar';
 
 $res = sub {
  for (1 .. 5) {
-  unwind qw/g h i/ => SUB;
+  unwind qw<g h i> => SUB;
  }
 }->(0);
 is $res, 'i', 'unwind in void context at sub across loop to scalar';
 
 $res = sub {
- for (6, unwind qw/j k l/ => SUB) {
+ for (6, unwind qw<j k l> => SUB) {
   $res = 'NO';
  }
  return 'XXX';
@@ -70,31 +70,31 @@ is $res, 'l', 'unwind in void context at sub across loop iterator to scalar';
 # --- Void to list ------------------------------------------------------------
 
 @res = sub {
- unwind qw/a b c/ => SUB;
+ unwind qw<a b c> => SUB;
  return 'XXX';
 }->(0);
-is_deeply \@res, [ qw/a b c/ ], 'unwind in void context at sub to list';
+is_deeply \@res, [ qw<a b c> ], 'unwind in void context at sub to list';
 
 @res = sub {
  eval {
-  unwind qw/d e f/ => SUB;
+  unwind qw<d e f> => SUB;
  };
  return 'XXX';
 }->(0);
-is_deeply \@res, [ qw/d e f/ ], 'unwind in void context at sub across eval to list';
+is_deeply \@res, [ qw<d e f> ], 'unwind in void context at sub across eval to list';
 
 @res = sub {
  for (1 .. 5) {
-  unwind qw/g h i/ => SUB;
+  unwind qw<g h i> => SUB;
  }
 }->(0);
-is_deeply \@res, [ qw/g h i/ ], 'unwind in void context at sub across loop to list';
+is_deeply \@res, [ qw<g h i> ], 'unwind in void context at sub across loop to list';
 
 # --- Scalar to void ----------------------------------------------------------
 
 sub {
  $res = 1;
- my $temp = unwind(qw/a b c/ => SUB);
+ my $temp = unwind(qw<a b c> => SUB);
  $res = 0;
 }->(0);
 ok $res, 'unwind in scalar context at sub to void';
@@ -102,7 +102,7 @@ ok $res, 'unwind in scalar context at sub to void';
 sub {
  $res = 1;
  my $temp = eval {
-  unwind(qw/d e f/ => SUB);
+  unwind(qw<d e f> => SUB);
  };
  $res = 0;
 }->(0);
@@ -111,7 +111,7 @@ ok $res, 'unwind in scalar context at sub across eval to void';
 sub {
  $res = 1;
  for (1 .. 5) {
-  my $temp = (unwind qw/g h i/ => SUB);
+  my $temp = (unwind qw<g h i> => SUB);
  }
  $res = 0;
 }->(0);
@@ -119,7 +119,7 @@ ok $res, 'unwind in scalar context at sub across loop to void';
 
 sub {
  $res = 1;
- if (unwind qw/m n o/ => SUB) {
+ if (unwind qw<m n o> => SUB) {
   $res = undef;
  }
  $res = 0;
@@ -129,19 +129,19 @@ ok $res, 'unwind in scalar context at sub across test to void';
 # --- Scalar to scalar --------------------------------------------------------
 
 $res = sub {
- 1, unwind(qw/a b c/ => SUB);
+ 1, unwind(qw<a b c> => SUB);
 }->(0);
 is $res, 'c', 'unwind in scalar context at sub to scalar';
 
 $res = sub {
  eval {
-  8, unwind qw/d e f/ => SUB;
+  8, unwind qw<d e f> => SUB;
  };
 }->(0);
 is $res, 'f', 'unwind in scalar context at sub across eval to scalar';
 
 $res = sub {
- if (unwind qw/m n o/ => SUB) {
+ if (unwind qw<m n o> => SUB) {
   return 'XXX';
  }
 }->(0);
@@ -150,17 +150,17 @@ is $res, 'o', 'unwind in scalar context at sub across test to scalar';
 # --- Scalar to list ----------------------------------------------------------
 
 @res = sub {
- if (unwind qw/m n o/ => SUB) {
+ if (unwind qw<m n o> => SUB) {
   return 'XXX';
  }
 }->(0);
-is_deeply \@res, [ qw/m n o/ ], 'unwind in scalar context at sub across test to list';
+is_deeply \@res, [ qw<m n o> ], 'unwind in scalar context at sub across test to list';
 
 # --- List to void ------------------------------------------------------------
 
 sub {
  $res = 1;
- my @temp = unwind(qw/a b c/ => SUB);
+ my @temp = unwind(qw<a b c> => SUB);
  $res = 0;
 }->(0);
 ok $res, 'unwind in list context at sub to void';
@@ -168,7 +168,7 @@ ok $res, 'unwind in list context at sub to void';
 sub {
  $res = 1;
  my @temp = eval {
-  unwind(qw/d e f/ => SUB);
+  unwind(qw<d e f> => SUB);
  };
  $res = 0;
 }->(0);
@@ -177,7 +177,7 @@ ok $res, 'unwind in list context at sub across eval to void';
 sub {
  $res = 1;
  for (1 .. 5) {
-  my @temp = (unwind qw/g h i/ => SUB);
+  my @temp = (unwind qw<g h i> => SUB);
  }
  $res = 0;
 }->(0);
@@ -185,7 +185,7 @@ ok $res, 'unwind in list context at sub across loop to void';
 
 sub {
  $res = 1;
- for (6, unwind qw/j k l/ => SUB) {
+ for (6, unwind qw<j k l> => SUB) {
   $res = undef;
  }
  $res = 0;
@@ -195,14 +195,14 @@ ok $res, 'unwind in list context at sub across test to void';
 # --- List to scalar ----------------------------------------------------------
 
 $res = sub {
- my @temp = (1, unwind(qw/a b c/ => SUB));
+ my @temp = (1, unwind(qw<a b c> => SUB));
  return 'XXX';
 }->(0);
 is $res, 'c', 'unwind in list context at sub to scalar';
 
 $res = sub {
  my @temp = eval {
-  8, unwind qw/d e f/ => SUB;
+  8, unwind qw<d e f> => SUB;
  };
  return 'XXX';
 }->(0);
@@ -210,14 +210,14 @@ is $res, 'f', 'unwind in list context at sub across eval to scalar';
 
 $res = sub {
  for (1 .. 5) {
-  my @temp = (7, unwind qw/g h i/ => SUB);
+  my @temp = (7, unwind qw<g h i> => SUB);
  }
  return 'XXX';
 }->(0);
 is $res, 'i', 'unwind in list context at sub across loop to scalar';
 
 $res = sub {
- for (6, unwind qw/j k l/ => SUB) {
+ for (6, unwind qw<j k l> => SUB) {
   return 'XXX';
  }
 }->(0);
@@ -226,27 +226,27 @@ is $res, 'l', 'unwind in list context at sub across loop iterator to scalar';
 # --- List to list ------------------------------------------------------------
 
 @res = sub {
- 2, unwind qw/a b c/ => SUB;
+ 2, unwind qw<a b c> => SUB;
 }->(0);
-is_deeply \@res, [ qw/a b c/ ], 'unwind in list context at sub to list';
+is_deeply \@res, [ qw<a b c> ], 'unwind in list context at sub to list';
 
 @res = sub {
  eval {
-  8, unwind qw/d e f/ => SUB;
+  8, unwind qw<d e f> => SUB;
  };
 }->(0);
-is_deeply \@res, [ qw/d e f/ ], 'unwind in list context at sub across eval to list';
+is_deeply \@res, [ qw<d e f> ], 'unwind in list context at sub across eval to list';
 
 @res = sub {
- for (6, unwind qw/j k l/ => SUB) {
+ for (6, unwind qw<j k l> => SUB) {
   return 'XXX';
  }
 }->(0);
-is_deeply \@res, [ qw/j k l/ ], 'unwind in list context at sub across loop iterator to list';
+is_deeply \@res, [ qw<j k l> ], 'unwind in list context at sub across loop iterator to list';
 
 # --- Prototypes --------------------------------------------------------------
 
-sub pie { 7, unwind qw/pie good/, $_[0] => SUB }
+sub pie { 7, unwind qw<pie good>, $_[0] => SUB }
 
 sub wlist (@) { return @_ }
 
@@ -254,7 +254,7 @@ $res = wlist pie 1;
 is $res, 3, 'unwind to list prototype to scalar';
 
 @res = wlist pie 2;
-is_deeply \@res, [ qw/pie good 2/ ], 'unwind to list prototype to list';
+is_deeply \@res, [ qw<pie good 2> ], 'unwind to list prototype to list';
 
 sub wscalar ($$) { return @_ }