Add a test that "eval" does not create additional reference to ouside variables.
[p5sagit/p5-mst-13.2.git] / t / op / smartmatch.t
index 33836b3..f8a073b 100644 (file)
@@ -18,8 +18,8 @@ my @empty;
 my %empty;
 my @sparse; $sparse[2] = 2;
 
-my $deep1 = []; push @$deep1, \$deep1;
-my $deep2 = []; push @$deep2, \$deep2;
+my $deep1 = []; push @$deep1, $deep1;
+my $deep2 = []; push @$deep2, $deep2;
 
 my @nums = (1..10);
 tie my @tied_nums, 'Tie::StdArray';
@@ -73,7 +73,7 @@ my %keyandmore = map { $_ => 0 } @keyandmore;
 my %fooormore = map { $_ => 0 } @fooormore;
 
 # Load and run the tests
-plan tests => 322;
+plan tests => 335;
 
 while (<DATA>) {
   SKIP: {
@@ -483,3 +483,18 @@ __DATA__
        @nums           {  1, '',  2, '' }
        @nums           {  1, '', 12, '' }
 !      @nums           { 11, '', 12, '' }
+
+# UNDEF
+!      3               undef
+!      1               undef
+!      []              undef
+!      {}              undef
+!      \%::main        undef
+!      [1,2]           undef
+!      %hash           undef
+!      @nums           undef
+!      "foo"           undef
+!      ""              undef
+!      !1              undef
+!      \&foo           undef
+!      sub { }         undef