X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F006-addsub.t;fp=t%2F006-addsub.t;h=0000000000000000000000000000000000000000;hb=988beb418b12b8cc4821055d79361f807c98aa36;hp=3c0dfc8a92c2b2e1ee4affa727ab444b808d186b;hpb=a9daba9ef318d1fd94851773d6c3f061ce5dae04;p=gitmo%2FPackage-Stash-XS.git diff --git a/t/006-addsub.t b/t/006-addsub.t deleted file mode 100644 index 3c0dfc8..0000000 --- a/t/006-addsub.t +++ /dev/null @@ -1,45 +0,0 @@ -use strict; -use warnings; - -use Test::More; -use Test::Exception; - -BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE - -use Package::Stash; - -my $foo_stash = Package::Stash->new('Foo'); - -# ---------------------------------------------------------------------- -## test adding a CODE - -ok(!defined($Foo::{funk}), '... the &funk slot has not been created yet'); - -lives_ok { - $foo_stash->add_package_symbol('&funk' => sub { "Foo::funk", __LINE__ }); -} '... created &Foo::funk successfully'; - -ok(defined($Foo::{funk}), '... the &funk slot was created successfully'); - -{ - no strict 'refs'; - ok(defined &{'Foo::funk'}, '... our &funk exists'); -} - -is((Foo->funk())[0], 'Foo::funk', '... got the right value from the function'); - -my $line = (Foo->funk())[1]; -is $DB::sub{'Foo::funk'}, sprintf "%s:%d-%d", __FILE__, $line, $line, - '... got the right %DB::sub value for funk default args'; - -$foo_stash->add_package_symbol( - '&dunk' => sub { "Foo::dunk" }, - filename => "FileName", - first_line_num => 100, - last_line_num => 199 -); - -is $DB::sub{'Foo::dunk'}, sprintf "%s:%d-%d", "FileName", 100, 199, - '... got the right %DB::sub value for dunk with specified args'; - -done_testing;