summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/op/ref.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/op/ref.t')
-rwxr-xr-xcontrib/perl5/t/op/ref.t22
1 files changed, 15 insertions, 7 deletions
diff --git a/contrib/perl5/t/op/ref.t b/contrib/perl5/t/op/ref.t
index 1d70f9f..a2baab8 100755
--- a/contrib/perl5/t/op/ref.t
+++ b/contrib/perl5/t/op/ref.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..55\n";
+print "1..56\n";
# Test glob operations.
@@ -241,11 +241,11 @@ print $$_,"\n";
package A;
sub new { bless {}, shift }
DESTROY { print "# destroying 'A'\nok 51\n" }
- package B;
+ package _B;
sub new { bless {}, shift }
- DESTROY { print "# destroying 'B'\nok 50\n"; bless shift, 'A' }
+ DESTROY { print "# destroying '_B'\nok 50\n"; bless shift, 'A' }
package main;
- my $b = B->new;
+ my $b = _B->new;
}
# test if $_[0] is properly protected in DESTROY()
@@ -271,14 +271,22 @@ print $$_,"\n";
print "# good, didn't recurse\n";
}
+# test if refgen behaves with autoviv magic
+
+{
+ my @a;
+ $a[1] = "ok 53\n";
+ print ${\$_} for @a;
+}
+
# test global destruction
package FINALE;
{
- $ref3 = bless ["ok 55\n"]; # package destruction
- my $ref2 = bless ["ok 54\n"]; # lexical destruction
- local $ref1 = bless ["ok 53\n"]; # dynamic destruction
+ $ref3 = bless ["ok 56\n"]; # package destruction
+ my $ref2 = bless ["ok 55\n"]; # lexical destruction
+ local $ref1 = bless ["ok 54\n"]; # dynamic destruction
1; # flush any temp values on stack
}
OpenPOWER on IntegriCloud