Ditch done_testing - less Test::More upgrade-churn
[p5sagit/namespace-clean.git] / t / 07-debugger.t
CommitLineData
80e4e267 1use Test::More;
2
3BEGIN {
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 }
39bc2d6e 12 else {
13 plan tests => 4;
14 }
7f55a1ec 15}
16
7f55a1ec 17BEGIN {
ac5c00e9 18 # shut up the debugger
80e4e267 19 $ENV{PERLDB_OPTS} = 'NonStop';
20}
21
22BEGIN {
23
24#line 1
25#!/usr/bin/perl -d
39bc2d6e 26#line 27
80e4e267 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
44ok( !Foo->can("foo"), "foo cleaned up" );
45ok( !Foo->can("baz"), "baz cleaned up" );
46
47Foo->bar();