This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix up \cX for 5.14
[perl5.git] / t / op / gv.t
index 807d9b2..c1d5f83 100644 (file)
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
 
 use warnings;
 
-plan( tests => 230 );
+plan( tests => 231 );
 
 # type coersion on assignment
 $foo = 'foo';
@@ -366,7 +366,7 @@ is (ref $::{ga_shloip}, 'SCALAR', "Export of proxy constant as is");
 is (ref $::{oonk}, 'SCALAR', "Export doesn't affect original");
 is (eval 'ga_shloip', "Value", "Constant has correct value");
 is (ref $::{ga_shloip}, 'SCALAR',
-    "Inlining of constant doesn't change represenatation");
+    "Inlining of constant doesn't change representation");
 
 delete $::{ga_shloip};
 
@@ -566,7 +566,7 @@ foreach my $value ([1,2,3], {1=>2}, *STDOUT{IO}, \&ok, *STDOUT{FORMAT}) {
     $::{BONK} = \"powie";
     *{"BONK"} = \&{"BONK"};
     eval 'is(BONK(), "powie",
-             "Assigment works when glob created midway (bug 45607)"); 1'
+             "Assignment works when glob created midway (bug 45607)"); 1'
        or die $@;
 }
 
@@ -610,7 +610,7 @@ foreach my $type (qw(integer number string)) {
     local $SIG{__WARN__} = sub { $warn = $_[0] };
     use warnings;
     my $str = "$glob";
-    is($warn, '', "RT #60954 anon glob stringification shouln't warn");
+    is($warn, '', "RT #60954 anon glob stringification shouldn't warn");
     is($str,  '', "RT #60954 anon glob stringification should be empty");
 }
 
@@ -825,6 +825,7 @@ pass('Can assign strings to typeglobs');
   tie my $a, "thrext";
   () = "$a"; # do a fetch; now $a holds a glob
   eval { *$a = sub{} };
+  eval { $a = undef }; # workaround for untie($handle) bug
   untie $a;
   eval { $a = "bar" };
   ::is $a, "bar",
@@ -846,7 +847,7 @@ ok eval {
 # These two crashed in 5.13.6. They were likewise fixed in 5.13.7.
 ok eval {
   sub greck;
-  my $glob = \*phing::foo;
+  my $glob = do { no warnings "once"; \*phing::foo};
   delete $::{"phing::"};
   *$glob = *greck; 
 }, "Assigning a glob-with-sub to a glob that has lost its stash warks";
@@ -857,6 +858,21 @@ ok eval {
   *$glob = *foo; 
 }, "Assigning a glob to a glob-with-sub that has lost its stash warks";
 
+{
+  package Tie::Alias;
+  sub TIESCALAR{ bless \\pop }
+  sub FETCH { $${$_[0]} }
+  sub STORE { $${$_[0]} = $_[1] }
+  package main;
+  tie my $alias, 'Tie::Alias', my $var;
+  no warnings 'once';
+  $var = *galobbe;
+  {
+    local *$alias = [];
+    $var = 3;
+    is $alias, 3, "[perl #77926] Glob reification during localisation";
+  }
+}
 
 __END__
 Perl