Make sure t/10-pure-perl.t runs are identical regardless of invocation
[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 }
7f55a1ec 12}
13
7f55a1ec 14BEGIN {
ac5c00e9 15 # shut up the debugger
80e4e267 16 $ENV{PERLDB_OPTS} = 'NonStop';
17}
18
19BEGIN {
20
21#line 1
22#!/usr/bin/perl -d
23#line 10
24
25}
26
27{
28 package Foo;
29
30 BEGIN { *baz = sub { 42 } }
31 sub foo { 22 }
32
33 use namespace::clean;
34
35 sub bar {
36 ::is(baz(), 42);
37 ::is(foo(), 22);
38 }
39}
40
41ok( !Foo->can("foo"), "foo cleaned up" );
42ok( !Foo->can("baz"), "baz cleaned up" );
43
44Foo->bar();
45
46done_testing;