This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test unpack with no args
[perl5.git] / t / comp / bproto.t
index 68b9786..bc0f1a2 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
     @INC = '../lib';
 }
 
     @INC = '../lib';
 }
 
-print "1..13\n";
+print "1..14\n";
 
 my $i = 1;
 
 
 my $i = 1;
 
@@ -21,6 +21,12 @@ sub test_too_many {
     printf "ok %d\n",$i++;
 }
 
     printf "ok %d\n",$i++;
 }
 
+sub test_too_few {
+    eval $_[0];
+    print "not " unless $@ =~ /^Not enough arguments/;
+    printf "ok %d\n",$i++;
+}
+
 sub test_no_error {
     eval $_[0];
     print "not " if $@;
 sub test_no_error {
     eval $_[0];
     print "not " if $@;
@@ -33,6 +39,10 @@ q[   defined(&foo, $bar);
        uc($bar,$bar);
 ];
 
        uc($bar,$bar);
 ];
 
+test_too_few($_) for split /\n/,
+q[     unpack;
+];
+
 test_no_error($_) for split /\n/,
 q[     scalar(&foo,$bar);
        defined &foo, &foo, &foo;
 test_no_error($_) for split /\n/,
 q[     scalar(&foo,$bar);
        defined &foo, &foo, &foo;