Version 0.12.
[p5sagit/namespace-clean.git] / t / 07-debugger.t
1 #!/usr/bin/perl -d
2
3 BEGIN {
4     push @DB::typeahead, "c", "q";
5
6     # try to shut it up at least a little bit
7     open my $out, ">", \my $out_buf;
8     $DB::OUT = $out;
9     open my $in, "<", \my $in_buf;
10     $DB::IN = $in;
11 }
12
13 {
14     package Foo;
15
16     BEGIN { *baz = sub { 42 } }
17     sub foo { 22 }
18
19     use namespace::clean;
20
21     sub bar {
22         ::is(baz(), 42);
23         ::is(foo(), 22);
24     }
25 }
26
27 use Test::More tests => 5;
28
29 ok( !Foo->can("foo"), "foo cleaned up" );
30 ok( !Foo->can("baz"), "baz cleaned up" );
31
32 Foo->bar();
33
34 pass();