File: sub-name.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 (16 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use strict;
use warnings;
use Test::More 0.88;
use Test::Needs qw(Sub::Name);

{
  package Foo;
  use namespace::autoclean;
  use Sub::Name;
  *tiger = *tiger = subname tiger => sub { };
}

ok( Foo->can('tiger'), 'Foo can tiger - anon sub named with subname assigned to glob');
ok(!Foo->can('subname'), 'Foo cannot subname - sub imported from Sub::Name');

done_testing();