1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/env perl use strict; use warnings; use Test::More; use lib 't/fun/lib'; use Test::Requires 'Sub::Name'; use Fun; fun Foo::foo ($x, $y) { $x + $y; } ok(!main->can('foo')); ok(Foo->can('foo')); is(Foo::foo(1, 2), 3); done_testing;