+ unless ($3) {
+ $tests ++;
+ eval " &CORE::$o(1,2) ";
+ like $@, qr/^Too many arguments for ${\op_desc($o)} at /,
+ "&$o with too many args";
+ }
+ unless ($1) {
+ $tests ++;
+ eval { &{"CORE::$o"}($3 ? 1 : ()) };
+ like $@, qr/^Not enough arguments for $o at /,
+ "&$o with too few args";
+ }
+ my $more_args = $3 ? ',1' : '';
+ eval " &CORE::$o(2$more_args) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be reference to one of(?x:
+ ) \[\Q$2\E\] at /,
+ "&$o with non-ref arg";
+ eval " &CORE::$o(*STDOUT{IO}$more_args) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be reference to one of(?x:
+ ) \[\Q$2\E\] at /,
+ "&$o with ioref arg";
+ my $class = ref *DATA{IO};
+ eval " &CORE::$o(bless(*DATA{IO}, 'hov')$more_args) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be reference to one of(?x:
+ ) \[\Q$2\E\] at /,
+ "&$o with ioref arg with hash overload (which does not count)";
+ bless *DATA{IO}, $class;
+ if (do {$2 !~ /&/}) {
+ $tests++;
+ eval " &CORE::$o(\\&scriggle$more_args) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be reference to one (?x:
+ )of \[\Q$2\E\] at /,
+ "&$o with coderef arg";
+ }
+ }
+ elsif ($p =~ /^;?\\\@([\@;])?/) { # ;\@ \@@ \@;$$@
+ $tests += 7;
+
+ if ($1) {
+ eval { &{"CORE::$o"}() };
+ like $@, qr/^Not enough arguments for $o at /,
+ "&$o with too few args";
+ }
+ else {
+ eval " &CORE::$o(\\\@1,2) ";
+ like $@, qr/^Too many arguments for $o at /,
+ "&$o with too many args";
+ }
+ eval " &CORE::$o(2) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with non-ref arg";
+ eval " &CORE::$o(*STDOUT{IO}) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with ioref arg";
+ my $class = ref *DATA{IO};
+ eval " &CORE::$o(bless(*DATA{IO}, 'aov')) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with ioref arg with array overload (which does not count)";
+ bless *DATA{IO}, $class;
+ eval " &CORE::$o(\\&scriggle) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with coderef arg";
+ eval " &CORE::$o(\\\$_) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with scalarref arg";
+ eval " &CORE::$o({}) ";
+ like $@, qr/^Type of arg 1 to &CORE::$o must be array reference at /,
+ "&$o with hashref arg";
+ }
+ elsif ($p eq '\[%@]') {
+ $tests += 7;
+
+ eval " &CORE::$o(\\%1,2) ";
+ like $@, qr/^Too many arguments for ${\op_desc($o)} at /,
+ "&$o with too many args";
+ eval { &{"CORE::$o"}() };