nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

mro/isarev.t fails for: replacing an alias updates isarev of stashes nested in the replacement #353

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From mro/isarev.t:

The failure test is:  "replacing an alias updates isarev of stashes nested in 
the replacement";

Program:
------
@Disease::Eye::ISA = "Disease";
@Disease::Eye::Infectious::ISA = "Disease::Eye";
@Keratoconjunctivitis::ISA = "Disease::Ophthalmic::Infectious";
*Disease::Ophthalmic:: = *Disease::Eye::;
{package some_random_new_symbol::Infectious} # autovivify
*Disease::Ophthalmic:: = *some_random_new_symbol::;

my $rev = mro::get_isarev("some_random_new_symbol::Infectious");
if($rev->[0] eq "Keratoconjunctivitis") {
    print "ok\n"
}
else {
    print "not ok\n";
}
------

$>t/CORE-CPANEL/mro/isarev.bin                                                  

not ok

$>perl t/CORE-CPANEL/mro/isarev.t  
ok

Original issue reported on code.google.com by todd.e.rinaldo on 7 Jul 2014 at 8:09

GoogleCodeExporter commented 9 years ago
I only accept valid and public tests. Use t/CORE/mro/isarev.t
You would have seen the fixes for the invalid glob assignments there, 
and the workarounds.

with the proper testfile you get:
$ perlcc -r t/CORE/mro/isarev.t
1..24
ok 1 - subclasses and subsubclasses are added to isarev
ok 2 - single deletion from isarev
ok 3 - recursive deletion from isarev
ok 4 - deleting a stash elem updates isarev entries
ok 5 - deleting a nested stash elem updates isarev entries
ok 6 - deleting a doubly nested stash elem updates isarev entries
not ok 7 - isarev includes subclasses of aliases
# Failed at t/CORE/mro/isarev.t line 66
#      got "Goat::Dairy Goat::Dairy::Toggenburg"
# expected "Goat::Dairy Goat::Dairy::Toggenburg Weird::Thing"
ok 8 - deleting an alias to a package updates isarev entries
ok 9 - deleting an alias to a package updates isarev entries of nested stashes
ok 10 - deleting an stash alias updates isarev entries of doubly nested stashes
ok 11 - subclasses of the deleted alias become part of its isarev
not ok 12 - replacing a stash updates isarev entries
# Failed at t/CORE/mro/isarev.t line 86
#      got "Caprid Caprine::Dairy Caprine::Dairy::Oberhasli"
# expected "Caprid"
not ok 13 - replacing nested stashes updates isarev entries
# Failed at t/CORE/mro/isarev.t line 88
#      got ""
# expected "Caprid::Dairy Whatever"
ok 14 - replacing an alias of a stash updates isarev entries
ok 15 - replacing an alias of a stash containing another updates isarev entries
not ok 16 - replacing an alias updates isarev of stashes nested in the 
replacement
# Failed at t/CORE/mro/isarev.t line 101
#      got ""
# expected "Keratoconjunctivitis"
ok 17 - assigning to an empty spot updates isarev
not ok 18 - assigning to an empty spot updates isarev of nested packages
# Failed at t/CORE/mro/isarev.t line 112
#      got ""
# expected "Null::Null"
ok 19 - assigning to two superclasses at the same time
Can't locate package xB::B for @foo::ISA at t/CORE/mro/isarev.t line 124.
ok 20 - A class must not inherit from its superclass’s former name
ok 21 - undeffing an ISA glob deletes isarev entries
ok 22 - undeffing a package glob deletes isarev entries
ok 23 - clobbering a class w/multiple layers of subclasses updates its parent
ok 24 - %Package:: list assignment

Original comment by reini.urban on 7 Jul 2014 at 10:14