From 0643ac23d9959ac64e372f8c84ce026bffd9d7bf Mon Sep 17 00:00:00 2001 From: Torsten Schoenfeld Date: Sat, 15 Nov 2008 22:24:40 +0100 Subject: MRO tests for isa() and package aliases Message-ID: <491F3008.4060205@gmx.de> p4raw-id: //depot/perl@34839 --- t/mro/package_aliases.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 t/mro/package_aliases.t (limited to 't') 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'); -- cgit v1.2.1