use
strict;
use
warnings;
use
Test::More;
{
my
$x
=
'a'
;
sub
new {
bless
[]=>
shift
}
sub
foo {
return
$x
++ }
}
{
BEGIN {
our
@ISA
=
'Local::Class'
};
override
foo
=>
sub
{
my
$letter
= super();
return
uc
$letter
;
}
}
{
BEGIN {
our
@ISA
=
'Local::Subclass'
};
override
foo
=>
sub
{
my
$letter
= super();
return
"X${letter}X"
;
}
}
my
$obj
= Local::More::->new;
is(
$obj
->foo,
"XAX"
);
is(
$obj
->foo,
"XBX"
);
is(
$obj
->foo,
"XCX"
);
done_testing;