This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test for the interaction between ; and _ in prototypes
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 18 Oct 2006 14:41:26 +0000 (14:41 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 18 Oct 2006 14:41:26 +0000 (14:41 +0000)
p4raw-id: //depot/perl@29039

t/comp/uproto.t

index d09461f..f5472d5 100644 (file)
@@ -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");