Ditch done_testing - less Test::More upgrade-churn
[p5sagit/namespace-clean.git] / t / 07-debugger.t
1 use Test::More;
2
3 BEGIN {
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   }
12   else {
13     plan tests => 4;
14   }
15 }
16
17 BEGIN {
18   # shut up the debugger
19   $ENV{PERLDB_OPTS} = 'NonStop';
20 }
21
22 BEGIN {
23
24 #line 1
25 #!/usr/bin/perl -d
26 #line 27
27
28 }
29
30 {
31     package Foo;
32
33     BEGIN { *baz = sub { 42 } }
34     sub foo { 22 }
35
36     use namespace::clean;
37
38     sub bar {
39         ::is(baz(), 42);
40         ::is(foo(), 22);
41     }
42 }
43
44 ok( !Foo->can("foo"), "foo cleaned up" );
45 ok( !Foo->can("baz"), "baz cleaned up" );
46
47 Foo->bar();