From: Vincent Pit Date: Sun, 27 Feb 2011 18:57:42 +0000 (+0100) Subject: Also test calls to code references X-Git-Tag: v0.05~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3780395c704fe993f7f63af51c9afc276293fb5f;p=perl%2Fmodules%2FB-RecDeparse.git Also test calls to code references --- diff --git a/t/17-calls.t b/t/17-calls.t index 8db7ac4..76e8a3c 100644 --- a/t/17-calls.t +++ b/t/17-calls.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 2 * 4 * 5; +use Test::More tests => 2 * 4 * 6; use B::RecDeparse; @@ -11,6 +11,7 @@ my $brd = B::RecDeparse->new(level => -1); sub foo { 123 } my $pkg; +my $coderef; my @tests = ( [ e1 => 'foo()', '123' ], @@ -23,6 +24,11 @@ my @tests = ( [ x3 => 'bar(@_)', 'bar' ], [ x4 => 'bar(shift)', 'bar' ], + [ c1 => '$coderef->()', 'coderef' ], + [ c2 => '$coderef->(1)', 'coderef' ], + [ c3 => '$coderef->(@_)', 'coderef' ], + [ c4 => '$coderef->(shift)', 'coderef' ], + [ m1 => '"pkg"->qux()', 'qux' ], [ m2 => '"pkg"->qux(1)', 'qux' ], [ m3 => '"pkg"->qux(@_)', 'qux' ],