Add an once-and-for-all workaround for Package::Stash::XS + =< 5.8.6
[p5sagit/namespace-clean.git] / t / 07-debugger.t
1 use Test::More;
2
3 BEGIN {
4   eval { require Sub::Name }
5     or plan skip_all => "Test requires Sub::Name";
6
7   eval { require Sub::Identify }
8     or plan skip_all => "Test requires Sub::Identify";
9 }
10
11
12 BEGIN {
13   # shut up the debugger
14   $ENV{PERLDB_OPTS} = 'NonStop';
15 }
16
17 BEGIN {
18
19 #line 1
20 #!/usr/bin/perl -d
21 #line 10
22
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
39 ok( !Foo->can("foo"), "foo cleaned up" );
40 ok( !Foo->can("baz"), "baz cleaned up" );
41
42 Foo->bar();
43
44 done_testing;