Change 34846 by [EMAIL PROTECTED] on 2008/11/16 18:29:22
Integrate:
[ 34839]
Subject: MRO tests for isa() and package aliases
From: Torsten Schoenfeld <[EMAIL PROTECTED]>
Date: Sat, 15 Nov 2008 21:24:40 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.10/perl/MANIFEST#53 integrate
... //depot/maint-5.10/perl/t/mro/package_aliases.t#1 branch
Differences ...
==== //depot/maint-5.10/perl/MANIFEST#53 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#52~34665~ 2008-10-30 07:48:53.000000000 -0700
+++ perl/MANIFEST 2008-11-16 10:29:22.000000000 -0800
@@ -3844,6 +3844,7 @@
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
==== //depot/maint-5.10/perl/t/mro/package_aliases.t#1 (text) ====
Index: perl/t/mro/package_aliases.t
--- /dev/null 2008-11-04 07:18:13.288883315 -0800
+++ perl/t/mro/package_aliases.t 2008-11-16 10:29:22.000000000 -0800
@@ -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');
End of Patch.