Commit | Line | Data |
909ce052 |
1 | use Test::More; |
2 | |
07fbef3d |
3 | BEGIN { |
f9132765 |
4 | plan skip_all => 'Only applicable on perl >= 5.8.9' |
5 | if $] <= 5.008008; |
6 | |
7 | #line 1 |
8 | #!/usr/bin/perl -d |
9 | #line 10 |
909ce052 |
10 | |
f9132765 |
11 | push @DB::typeahead, "c", "q"; |
07fbef3d |
12 | |
13 | # try to shut it up at least a little bit |
14 | open my $out, ">", \my $out_buf; |
15 | $DB::OUT = $out; |
16 | open my $in, "<", \my $in_buf; |
17 | $DB::IN = $in; |
18 | } |
19 | |
20 | { |
21 | package Foo; |
22 | |
23 | BEGIN { *baz = sub { 42 } } |
24 | sub foo { 22 } |
25 | |
26 | use namespace::clean; |
27 | |
28 | sub bar { |
29 | ::is(baz(), 42); |
30 | ::is(foo(), 22); |
31 | } |
32 | } |
33 | |
07fbef3d |
34 | ok( !Foo->can("foo"), "foo cleaned up" ); |
35 | ok( !Foo->can("baz"), "baz cleaned up" ); |
36 | |
37 | Foo->bar(); |
38 | |
909ce052 |
39 | done_testing; |