diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-19 10:26:54 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-19 10:26:54 +0000 |
commit | cb40c25d04faeb4e704ac10e016eece055ac741f (patch) | |
tree | ea823d1ba95659c3e58962852876460d7ca4568e /t/comp | |
parent | 4d5114b49dd32c765f1137162d67b9cab5c5ba5a (diff) | |
download | perl-cb40c25d04faeb4e704ac10e016eece055ac741f.tar.gz |
Allow the _ prototype character to be followed by optional arguments
p4raw-id: //depot/perl@29048
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/uproto.t | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/t/comp/uproto.t b/t/comp/uproto.t index 87c8be5e10..3da64d44a1 100644 --- a/t/comp/uproto.t +++ b/t/comp/uproto.t @@ -6,7 +6,7 @@ BEGIN { require "./test.pl"; } -plan(tests => 33); +plan(tests => 36); sub f($$_) { my $x = shift; is("@_", $x) } @@ -67,5 +67,10 @@ like( $@, qr/Malformed prototype for main::wrong2/, 'wrong2' ); sub opt ($;_) { is($_[0], "seen"); ok(!defined $_[1], "; has precedence over _") } opt("seen"); -sub unop (_) { is($_[0],11) } +sub unop (_) { is($_[0], 11, "unary op") } unop 11, 22; # takes only the first parameter into account + +sub mymkdir (_;$) { is("@_", $expected, "mymkdir") } +$expected = $_ = "mydir"; mymkdir(); +mymkdir($expected = "foo"); +$expected = "foo 493"; mymkdir foo => 0755; |