This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bring '*' prototype closer to how it behaves internally
[perl5.git] / t / comp / bproto.t
CommitLineData
62c18ce2
GS
1#!./perl
2#
3# check if builtins behave as prototyped
4#
5
6BEGIN {
7 chdir 't' if -d 't';
8 unshift @INC, '../lib';
9}
10
11print "1..7\n";
12
13my $i = 1;
14
15sub foo {}
16my $bar = "bar";
17
18sub test_too_many {
19 eval $_[0];
20 print "not " unless $@ =~ /^Too many arguments/;
21 printf "ok %d\n",$i++;
22}
23
24sub test_no_error {
25 eval $_[0];
26 print "not " if $@;
27 printf "ok %d\n",$i++;
28}
29
30test_too_many($_) for split /\n/,
31q[ defined(&foo, $bar);
32 undef(&foo, $bar);
33 uc($bar,$bar);
34];
35
36test_no_error($_) for split /\n/,
37q[ scalar(&foo,$bar);
38 defined &foo, &foo, &foo;
39 undef &foo, $bar;
40 uc $bar,$bar;
41];