From: Rafael Garcia-Suarez Date: Wed, 18 Oct 2006 14:41:26 +0000 (+0000) Subject: Test for the interaction between ; and _ in prototypes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5df4b323ce05ce1c7f9261685804fb4bc7aadbce;p=p5sagit%2Fp5-mst-13.2.git Test for the interaction between ; and _ in prototypes p4raw-id: //depot/perl@29039 --- diff --git a/t/comp/uproto.t b/t/comp/uproto.t index d09461f..f5472d5 100644 --- a/t/comp/uproto.t +++ b/t/comp/uproto.t @@ -6,7 +6,7 @@ BEGIN { require "./test.pl"; } -plan(tests => 30); +plan(tests => 32); sub f($$_) { my $x = shift; is("@_", $x) } @@ -63,3 +63,6 @@ like( $@, qr/Malformed prototype for main::wrong1/, 'wrong1' ); eval q{ sub wrong2 ($__); wrong2(1,2) }; like( $@, qr/Malformed prototype for main::wrong2/, 'wrong2' ); + +sub opt ($;_) { is($_[0], "seen"); ok(!defined $_[1], "; has precedence over _") } +opt("seen");