File: basic.t

package info (click to toggle)
libnamespace-autoclean-perl 0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 520 kB
  • sloc: perl: 580; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;
use Test::More 0.88;

{
    package Foo;
    sub bar { }
    use namespace::autoclean;
    sub moo { }
    BEGIN { *kooh = *kooh = do { package Moo; sub { }; }; }
    BEGIN { *affe = *affe = sub { }; }
}

ok( Foo->can('bar'), 'Foo can bar - standard method');
ok( Foo->can('moo'), 'Foo can moo - standard method');
ok(!Foo->can('kooh'), 'Foo cannot kooh - anon sub from another package assigned to glob');
ok( Foo->can('affe'), 'Foo can affe - anon sub assigned to glob in package');

done_testing();