6 use Test::More tests => 16;
18 sub foo { 'Foo::foo(' . (inner() || '') . ')' }
19 sub bar { 'Foo::bar(' . (inner() || '') . ')' }
20 sub baz { 'Foo::baz(' . (inner() || '') . ')' }
29 augment foo => sub { 'Bar::foo(' . (inner() || '') . ')' };
30 augment bar => sub { 'Bar::bar' };
39 augment foo => sub { 'Baz::foo' };
40 augment baz => sub { 'Baz::baz' };
42 # this will actually never run,
43 # because Bar::bar does not call inner()
44 augment bar => sub { 'Baz::bar' };
52 is($baz->foo(), 'Foo::foo(Bar::foo(Baz::foo))', '... got the right value from &foo');
53 is($baz->bar(), 'Foo::bar(Bar::bar)', '... got the right value from &bar');
54 is($baz->baz(), 'Foo::baz(Baz::baz)', '... got the right value from &baz');
60 is($bar->foo(), 'Foo::foo(Bar::foo())', '... got the right value from &foo');
61 is($bar->bar(), 'Foo::bar(Bar::bar)', '... got the right value from &bar');
62 is($bar->baz(), 'Foo::baz()', '... got the right value from &baz');
67 is($foo->foo(), 'Foo::foo()', '... got the right value from &foo');
68 is($foo->bar(), 'Foo::bar()', '... got the right value from &bar');
69 is($foo->baz(), 'Foo::baz()', '... got the right value from &baz');