Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / op / gv.t
index c9f7a86..9380735 100755 (executable)
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -11,7 +11,7 @@ BEGIN {
 
 use warnings;
 
-print "1..42\n";
+print "1..44\n";
 
 # type coersion on assignment
 $foo = 'foo';
@@ -105,6 +105,16 @@ print ref *x{FORMAT} eq "FORMAT" ? "ok 21\n" : "not ok 21\n";
 print *{*x{GLOB}} eq "*main::STDOUT" ? "ok 22\n" : "not ok 22\n";
 print {*x{IO}} "ok 23\n";
 
+{
+       my $warn;
+       local $SIG{__WARN__} = sub {
+               $warn .= $_[0];
+       };
+       my $val = *x{FILEHANDLE};
+       print {*x{IO}} ($warn =~ /is deprecated/ ? "ok 24\n" : "not ok 24\n");
+       
+}
+
 # test if defined() doesn't create any new symbols
 
 {
@@ -167,6 +177,14 @@ print {*x{IO}} "ok 23\n";
 }
 
 
+# [ID 20010526.001] localized glob loses value when assigned to
+
+$j=1; %j=(a=>1); @j=(1); local *j=*j; *j = sub{};
+
+print $j    == 1 ? "ok 41\n"  : "not ok 41\n";
+print $j{a} == 1 ? "ok 42\n"  : "not ok 42\n";
+print $j[0] == 1 ? "ok 43\n" : "not ok 43\n";
+
 # does pp_readline() handle glob-ness correctly?
 
 {
@@ -175,15 +193,5 @@ print {*x{IO}} "ok 23\n";
     print $g;
 }
 
-{
-       my $warn;
-       local $SIG{__WARN__} = sub {
-               $warn .= $_[0];
-       };
-       my $val = *x{FILEHANDLE};
-       print {*x{IO}} ($warn =~ /is deprecated/ ? "ok 42\n" : "not ok 42\n");
-       
-}
-
 __END__
-ok 41
+ok 44