7 BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
11 my $foo_stash = Package::Stash->new('Foo');
13 # ----------------------------------------------------------------------
16 ok(!defined($Foo::{funk}), '... the &funk slot has not been created yet');
19 $foo_stash->add_package_symbol('&funk' => sub { "Foo::funk", __LINE__ });
20 } '... created &Foo::funk successfully';
22 ok(defined($Foo::{funk}), '... the &funk slot was created successfully');
26 ok(defined &{'Foo::funk'}, '... our &funk exists');
29 is((Foo->funk())[0], 'Foo::funk', '... got the right value from the function');
31 my $line = (Foo->funk())[1];
32 is $DB::sub{'Foo::funk'}, sprintf "%s:%d-%d", __FILE__, $line, $line,
33 '... got the right %DB::sub value for funk default args';
35 $foo_stash->add_package_symbol(
36 '&dunk' => sub { "Foo::dunk" },
37 filename => "FileName",
38 first_line_num => 100,
42 is $DB::sub{'Foo::dunk'}, sprintf "%s:%d-%d", "FileName", 100, 199,
43 '... got the right %DB::sub value for dunk with specified args';