X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F10-base.t;h=62659d4f7a686fef078f9432e1a4e58d0ff7bfb3;hb=c38db653bec41568fc1caab3c19763e7ed2e5a2b;hp=891a8cbc693669dca37055f1c77b5f1b2449f078;hpb=0661466030b3dd0fb805da10aaed883fbe931093;p=perl%2Fmodules%2FSub-Op.git diff --git a/t/10-base.t b/t/10-base.t index 891a8cb..62659d4 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,15 +3,18 @@ use strict; use warnings; -use blib 't/Sub-Op-Test'; +use blib 't/Sub-Op-LexicalSub'; -use Test::More tests => 2 * 15 + 3 * 1 + 2 * 23; +use Test::More tests => 2 * 15 + 3 * 2 + 2 * 28; our $called; { local $/ = "####\n"; while () { + chomp; + s/\s*$//; + my ($code, $params) = split /----\s*/, $_; my ($names, $ret, $exp, $seq) = split /\s*#\s*/, $params; @@ -36,7 +39,7 @@ our $called; my $test = "{\n"; for my $name (@names) { $test .= <<" INIT" - use Sub::Op::Test $name => sub { + use Sub::Op::LexicalSub $name => sub { ++\$called; my \$exp = shift \@exp; is_deeply \\\@_, \$exp, '$name: arguments are correct'; @@ -142,3 +145,7 @@ foo 1; bar 2; ---- foo, bar # () # [ 1 ], [ 2 ] # foo, bar +#### +foo 1, foo(2), 3, bar(4, foo(bar, 5), 6); +---- +foo, bar # @_ # [ 2 ], [ ], [ 5 ], [ 4, 5, 6 ], [ 1, 2, 3, 4, 5, 6 ] # foo, bar, foo, bar, foo