14 sub foo { 'Foo::foo(' . (inner() || '') . ')' }
15 sub bar { 'Foo::bar(' . (inner() || '') . ')' }
16 sub baz { 'Foo::baz(' . (inner() || '') . ')' }
23 augment foo => sub { 'Bar::foo(' . (inner() || '') . ')' };
24 augment bar => sub { 'Bar::bar' };
26 no Moose; # ensure inner() still works after unimport
33 augment foo => sub { 'Baz::foo' };
34 augment baz => sub { 'Baz::baz' };
36 # this will actually never run,
37 # because Bar::bar does not call inner()
38 augment bar => sub { 'Baz::bar' };
46 is($baz->foo(), 'Foo::foo(Bar::foo(Baz::foo))', '... got the right value from &foo');
47 is($baz->bar(), 'Foo::bar(Bar::bar)', '... got the right value from &bar');
48 is($baz->baz(), 'Foo::baz(Baz::baz)', '... got the right value from &baz');
54 is($bar->foo(), 'Foo::foo(Bar::foo())', '... got the right value from &foo');
55 is($bar->bar(), 'Foo::bar(Bar::bar)', '... got the right value from &bar');
56 is($bar->baz(), 'Foo::baz()', '... got the right value from &baz');
61 is($foo->foo(), 'Foo::foo()', '... got the right value from &foo');
62 is($foo->bar(), 'Foo::bar()', '... got the right value from &bar');
63 is($foo->baz(), 'Foo::baz()', '... got the right value from &baz');
71 sub bling { 'Bling::bling' }
78 sub bling { 'Bling::bling' }
81 augment 'bling' => sub {};
82 } '... cannot augment a method which has a local equivalent';