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