Commit | Line | Data |
80e4e267 |
1 | use Test::More; |
2 | |
3 | BEGIN { |
df4cbc4e |
4 | require namespace::clean; |
5 | if ( |
6 | namespace::clean::_Util::DEBUGGER_NEEDS_CV_RENAME() |
7 | and |
8 | my $missing_xs = namespace::clean::_Util::_namer_load_error() |
9 | ) { |
10 | plan skip_all => $missing_xs; |
11 | } |
7f55a1ec |
12 | } |
13 | |
7f55a1ec |
14 | BEGIN { |
ac5c00e9 |
15 | # shut up the debugger |
80e4e267 |
16 | $ENV{PERLDB_OPTS} = 'NonStop'; |
17 | } |
18 | |
19 | BEGIN { |
20 | |
21 | #line 1 |
22 | #!/usr/bin/perl -d |
23 | #line 10 |
24 | |
25 | } |
26 | |
27 | { |
28 | package Foo; |
29 | |
30 | BEGIN { *baz = sub { 42 } } |
31 | sub foo { 22 } |
32 | |
33 | use namespace::clean; |
34 | |
35 | sub bar { |
36 | ::is(baz(), 42); |
37 | ::is(foo(), 22); |
38 | } |
39 | } |
40 | |
41 | ok( !Foo->can("foo"), "foo cleaned up" ); |
42 | ok( !Foo->can("baz"), "baz cleaned up" ); |
43 | |
44 | Foo->bar(); |
45 | |
46 | done_testing; |