Subject: | isa() does not understand aliases |
use strict;
use warnings;
use aliased 'Test::More' => 'Foo';
isa_ok('Test::More', 'Test::More');
isa_ok('Foo', 'Test::More');
isa_ok('Test::More', 'Foo');
my $obj = bless {}, 'Test::More';
isa_ok($obj, 'Test::More');
isa_ok($obj, 'Foo');
done_testing;
prints:
ok 1 - The class isa Test::More
not ok 2 - The class isa Test::More
# Failed test 'The class isa Test::More'
# at aliased.pl line 7.
# The class isn't a 'Test::More' it's a ''
not ok 3 - The class isa Foo
# Failed test 'The class isa Foo'
# at aliased.pl line 8.
# The class isn't a 'Foo' it's a ''
ok 4 - The object isa Test::More
not ok 5 - The object isa Foo
# Failed test 'The object isa Foo'
# at aliased.pl line 12.
# The object isn't a 'Foo' it's a 'Test::More'
1..5
# Looks like you failed 3 tests of 5.