3556a5dfdd4787a69bf460f3dba3a02998de284f
[p5sagit/namespace-clean.git] / t / 05-explicit-cleanee.t
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 use FindBin;
6 use lib "$FindBin::Bin/lib";
7 use Test::More tests => 19;
8
9 use_ok('CleaneeTarget');
10
11 ok  CleaneeTarget->can('IGNORED'),  'symbol in exception list still there';
12 ok  CleaneeTarget->can('NOTAWAY'),  'symbol after import call still there';
13 ok !CleaneeTarget->can('AWAY'),     'normal symbol has disappeared';
14
15 ok !CleaneeTarget->can('x_foo'),    'explicitely removed disappeared (1/2)';
16 ok  CleaneeTarget->can('x_bar'),    'not in explicit removal and still there';
17 ok !CleaneeTarget->can('x_baz'),    'explicitely removed disappeared (2/2)';
18
19 ok !CleaneeTarget->can('d_foo'),    'directly removed disappeared (1/2)';
20 ok  CleaneeTarget->can('d_bar'),    'not in direct removal and still there';
21 ok !CleaneeTarget->can('d_baz'),    'directly removed disappeared (2/2)';
22
23 my @values = qw( 23 27 17 XFOO XBAR XBAZ 7 8 9 );
24 is(CleaneeTarget->summary->[ $_ ], $values[ $_ ], sprintf('testing sub in cleanee (%d/%d)', $_ + 1, scalar @values))
25     for 0 .. $#values;