Add an once-and-for-all workaround for Package::Stash::XS + =< 5.8.6
[p5sagit/namespace-clean.git] / t / 07-debugger.t
CommitLineData
80e4e267 1use Test::More;
2
3BEGIN {
7f55a1ec 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
12BEGIN {
ac5c00e9 13 # shut up the debugger
80e4e267 14 $ENV{PERLDB_OPTS} = 'NonStop';
15}
16
17BEGIN {
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
39ok( !Foo->can("foo"), "foo cleaned up" );
40ok( !Foo->can("baz"), "baz cleaned up" );
41
42Foo->bar();
43
44done_testing;