This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: typo in comment
[perl5.git] / t / comp / bproto.t
1 #!./perl
2 #
3 # check if builtins behave as prototyped
4 #
5
6 BEGIN {
7     chdir 't' if -d 't';
8     @INC = '../lib';
9 }
10
11 print "1..14\n";
12
13 my $i = 1;
14
15 sub foo {}
16 my $bar = "bar";
17
18 sub test_too_many {
19     eval $_[0];
20     print "not " unless $@ =~ /^Too many arguments/;
21     printf "ok %d\n",$i++;
22 }
23
24 sub test_too_few {
25     eval $_[0];
26     print "not " unless $@ =~ /^Not enough arguments/;
27     printf "ok %d\n",$i++;
28 }
29
30 sub test_no_error {
31     eval $_[0];
32     print "not " if $@;
33     printf "ok %d\n",$i++;
34 }
35
36 test_too_many($_) for split /\n/,
37 q[      defined(&foo, $bar);
38         undef(&foo, $bar);
39         uc($bar,$bar);
40 ];
41
42 test_too_few($_) for split /\n/,
43 q[      unpack;
44 ];
45
46 test_no_error($_) for split /\n/,
47 q[      scalar(&foo,$bar);
48         defined &foo, &foo, &foo;
49         undef &foo, $bar;
50         uc $bar,$bar;
51         grep(not($bar), $bar);
52         grep(not($bar, $bar), $bar);
53         grep((not $bar, $bar, $bar), $bar);
54         __FILE__();
55         __LINE__();
56         __PACKAGE__();
57 ];