summaryrefslogtreecommitdiff
path: root/t/op/ref.t
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
commita0d0e21ea6ea90a22318550944fe6cb09ae10cda (patch)
treefaca1018149b736b1142f487e44d1ff2de5cc1fa /t/op/ref.t
parent85e6fe838fb25b257a1b363debf8691c0992ef71 (diff)
downloadperl-a0d0e21ea6ea90a22318550944fe6cb09ae10cda.tar.gz
perl 5.000perl-5.000
[editor's note: this commit combines approximate 4 months of furious releases of Andy Dougherty and Larry Wall - see pod/perlhist.pod for details. Andy notes that; Alas neither my "Irwin AccuTrack" nor my DC 600A quarter-inch cartridge backup tapes from that era seem to be readable anymore. I guess 13 years exceeds the shelf life for that backup technology :-(. ]
Diffstat (limited to 't/op/ref.t')
-rwxr-xr-xt/op/ref.t23
1 files changed, 16 insertions, 7 deletions
diff --git a/t/op/ref.t b/t/op/ref.t
index 60bb75ce33..73a54ff3c8 100755
--- a/t/op/ref.t
+++ b/t/op/ref.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..40\n";
+print "1..41\n";
# Test glob operations.
@@ -73,7 +73,7 @@ print ${$$ref[2]}[2] == 5 ? "ok 16\n" : "not ok 16\n";
print scalar @{$$ref[0]} == 0 ? "ok 17\n" : "not ok 17\n";
print $ref->[1] == 2 ? "ok 18\n" : "not ok 18\n";
-print $ref->[2]->[0] == 3 ? "ok 19\n" : "not ok 18\n";
+print $ref->[2]->[0] == 3 ? "ok 19\n" : "not ok 19\n";
# Test references to hashes of references.
@@ -151,8 +151,8 @@ DESTROY {
return unless $string;
print $string;
- # Test that the object has already been "cursed".
- print ref shift eq HASH ? "ok 35\n" : "not ok 35\n";
+ # Test that the object has not already been "cursed".
+ print ref shift ne HASH ? "ok 35\n" : "not ok 35\n";
}
# Now test inheritance of methods.
@@ -180,12 +180,21 @@ sub BASEOBJ'doit {
$ref->{shift};
}
+package UNIVERSAL;
+@ISA = 'LASTCHANCE';
+
+package LASTCHANCE;
+sub foo { print $_[1] }
+
+package WHATEVER;
+foo WHATEVER "ok 38\n";
+
package FINALE;
{
- $ref3 = bless ["ok 40\n"]; # package destruction
- my $ref2 = bless ["ok 39\n"]; # lexical destruction
- local $ref1 = bless ["ok 38\n"]; # dynamic destruction
+ $ref3 = bless ["ok 41\n"]; # package destruction
+ my $ref2 = bless ["ok 40\n"]; # lexical destruction
+ local $ref1 = bless ["ok 39\n"]; # dynamic destruction
1; # flush any temp values on stack
}