summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Schoenfeld <kaffeetisch@gmx.de>2008-11-15 22:24:40 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-11-16 08:31:37 +0000
commit0643ac23d9959ac64e372f8c84ce026bffd9d7bf (patch)
treef924643a8db44380a941e8ecb70f14dc224d954e
parent7d83ec39419221f3bdf531c4dd9017f46d10f92d (diff)
downloadperl-0643ac23d9959ac64e372f8c84ce026bffd9d7bf.tar.gz
MRO tests for isa() and package aliases
Message-ID: <491F3008.4060205@gmx.de> p4raw-id: //depot/perl@34839
-rw-r--r--MANIFEST1
-rw-r--r--t/mro/package_aliases.t33
2 files changed, 34 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index b0593d9293..5ddeec6567 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3919,6 +3919,7 @@ t/mro/next_NEXT.t mro tests
t/mro/next_skip.t mro tests
t/mro/overload_c3.t mro tests
t/mro/overload_dfs.t mro tests
+t/mro/package_aliases.t mro tests
t/mro/pkg_gen.t mro tests
t/mro/recursion_c3.t mro tests
t/mro/recursion_dfs.t mro tests
diff --git a/t/mro/package_aliases.t b/t/mro/package_aliases.t
new file mode 100644
index 0000000000..b8d03160ae
--- /dev/null
+++ b/t/mro/package_aliases.t
@@ -0,0 +1,33 @@
+#!./perl
+
+BEGIN {
+ unless (-d 'blib') {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
+}
+
+use strict;
+use warnings;
+require q(./test.pl); plan(tests => 4);
+
+{
+ package New;
+ use strict;
+ use warnings;
+
+ package Old;
+ use strict;
+ use warnings;
+
+ {
+ no strict 'refs';
+ *{'Old::'} = *{'New::'};
+ }
+}
+
+ok (Old->isa (New::), 'Old inherits from New');
+ok (New->isa (Old::), 'New inherits from Old');
+
+isa_ok (bless ({}, Old::), New::, 'Old object');
+isa_ok (bless ({}, New::), Old::, 'New object');