X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsmoke.t;h=a383789d9a22872d845c7cdab91ccb384b5993c9;hb=3967e6284e615ea53e8a93cd03376babe9f5339c;hp=87508ed6e6f3fd17a46fd6f49d799e277ba6acbc;hpb=bcbff2c187f54108e900e55bab0706b10965e6ab;p=p5sagit%2FSub-Name.git diff --git a/t/smoke.t b/t/smoke.t index 87508ed..a383789 100644 --- a/t/smoke.t +++ b/t/smoke.t @@ -1,11 +1,15 @@ #!/usr/bin/perl -BEGIN { print "1..5\n"; } +BEGIN { print "1..10\n"; $^P |= 0x210 } use Sub::Name; my $x = subname foo => sub { (caller 0)[3] }; +my $line = __LINE__ - 1; +my $file = __FILE__; +my $anon = $DB::sub{"main::__ANON__[${file}:${line}]"}; + print $x->() eq "main::foo" ? "ok 1\n" : "not ok 1\n"; @@ -26,4 +30,16 @@ for (4 .. 5) { print $x->() eq "Blork::Dynamic $_" ? "ok $_\n" : "not ok $_\n"; } +print $DB::sub{"main::foo"} eq $anon ? "ok 6\n" : "not ok 6\n"; + +for (4 .. 5) { + print $DB::sub{"Blork::Dynamic $_"} eq $anon ? "ok ".($_+3)."\n" : "not ok ".($_+3)."\n"; +} + +my $i = 9; +for ("Blork:: Bar!", "Foo::Bar::Baz") { + print $DB::sub{$_} eq $anon ? "ok $i\n" : "not ok $_ \n"; + $i++; +} + # vim: ft=perl