Change 34839 by [EMAIL PROTECTED] on 2008/11/16 08:31:37

        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/perl/MANIFEST#1750 edit
... //depot/perl/t/mro/package_aliases.t#1 add

Differences ...

==== //depot/perl/MANIFEST#1750 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#1749~34832~   2008-11-14 06:18:00.000000000 -0800
+++ perl/MANIFEST       2008-11-16 00:31:37.000000000 -0800
@@ -3919,6 +3919,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/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 00:31:37.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.

Reply via email to