1N/A#!./perl
1N/A#
1N/A# check if builtins behave as prototyped
1N/A#
1N/A
1N/ABEGIN {
1N/A chdir 't' if -d 't';
1N/A @INC = '../lib';
1N/A}
1N/A
1N/Aprint "1..10\n";
1N/A
1N/Amy $i = 1;
1N/A
1N/Asub foo {}
1N/Amy $bar = "bar";
1N/A
1N/Asub test_too_many {
1N/A eval $_[0];
1N/A print "not " unless $@ =~ /^Too many arguments/;
1N/A printf "ok %d\n",$i++;
1N/A}
1N/A
1N/Asub test_no_error {
1N/A eval $_[0];
1N/A print "not " if $@;
1N/A printf "ok %d\n",$i++;
1N/A}
1N/A
1N/Atest_too_many($_) for split /\n/,
1N/Aq[ defined(&foo, $bar);
1N/A undef(&foo, $bar);
1N/A uc($bar,$bar);
1N/A];
1N/A
1N/Atest_no_error($_) for split /\n/,
1N/Aq[ scalar(&foo,$bar);
1N/A defined &foo, &foo, &foo;
1N/A undef &foo, $bar;
1N/A uc $bar,$bar;
1N/A grep(not($bar), $bar);
1N/A grep(not($bar, $bar), $bar);
1N/A grep((not $bar, $bar, $bar), $bar);
1N/A];