This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add more tests to cproto.t
[perl5.git] / t / op / cproto.t
CommitLineData
c0222185
RGS
1#!./perl
2# Tests to ensure that we don't unexpectedly change prototypes of builtins
3
f26e2faa
JH
4BEGIN {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7}
8
0e7f5727 9BEGIN { require './test.pl'; }
d3dc34ae 10plan tests => 243;
0e7f5727 11
c0222185
RGS
12while (<DATA>) {
13 chomp;
59b085e1 14 (my $keyword, my $proto, local $TODO) = split " ", $_, 3;
c0222185
RGS
15 if ($proto eq 'undef') {
16 ok( !defined prototype "CORE::".$keyword, $keyword );
17 }
18 elsif ($proto eq 'unknown') {
19 eval { prototype "CORE::".$keyword };
20 like( $@, qr/Can't find an opnumber for/, $keyword );
21 }
22 else {
23 is( "(".prototype("CORE::".$keyword).")", $proto, $keyword );
24 }
25}
26
27# the keyword list :
28
29__DATA__
7c4c6e7c
FC
30__FILE__ ()
31__LINE__ ()
32__PACKAGE__ ()
d3dc34ae
FC
33__DATA__ undef
34__END__ undef
59b085e1 35abs (_)
c0222185 36accept (**)
59b085e1 37alarm (_)
95f7e41f 38and undef
c0222185
RGS
39atan2 ($$)
40bind (*$)
41binmode (*;$)
42bless ($;$)
43caller (;$)
44chdir (;$)
45chmod (@)
46chomp undef
47chop undef
48chown (@)
59b085e1
RGS
49chr (_)
50chroot (_)
c0222185
RGS
51close (;*)
52closedir (*)
95f7e41f 53cmp undef
c0222185 54connect (*$)
0d863452 55continue ()
59b085e1 56cos (_)
c0222185
RGS
57crypt ($$)
58dbmclose (\%)
59dbmopen (\%$$)
d3dc34ae 60default undef
c0222185
RGS
61defined undef
62delete undef
63die (@)
64do undef
65dump ()
cba5a3b0 66each (+)
c0222185
RGS
67else undef
68elsif undef
69endgrent ()
70endhostent ()
71endnetent ()
72endprotoent ()
73endpwent ()
74endservent ()
75eof (;*)
95f7e41f 76eq undef
c0222185
RGS
77eval undef
78exec undef
79exists undef
80exit (;$)
59b085e1 81exp (_)
c0222185
RGS
82fcntl (*$$)
83fileno (*)
84flock (*$)
85for undef
86foreach undef
87fork ()
88format undef
89formline ($@)
95f7e41f 90ge undef
c0222185
RGS
91getc (;*)
92getgrent ()
93getgrgid ($)
94getgrnam ($)
95gethostbyaddr ($$)
96gethostbyname ($)
97gethostent ()
98getlogin ()
99getnetbyaddr ($$)
100getnetbyname ($)
101getnetent ()
102getpeername (*)
103getpgrp (;$)
104getppid ()
105getpriority ($$)
106getprotobyname ($)
107getprotobynumber ($)
108getprotoent ()
109getpwent ()
110getpwnam ($)
111getpwuid ($)
112getservbyname ($$)
113getservbyport ($$)
114getservent ()
115getsockname (*)
116getsockopt (*$$)
5458a98a 117given undef
c0222185
RGS
118glob undef
119gmtime (;$)
120goto undef
121grep undef
95f7e41f 122gt undef
59b085e1 123hex (_)
c0222185
RGS
124if undef
125index ($$;$)
59b085e1 126int (_)
c0222185
RGS
127ioctl (*$$)
128join ($@)
cba5a3b0 129keys (+)
c0222185
RGS
130kill (@)
131last undef
59b085e1
RGS
132lc (_)
133lcfirst (_)
95f7e41f 134le undef
59b085e1 135length (_)
c0222185
RGS
136link ($$)
137listen (*$)
138local undef
139localtime (;$)
3fdd840f 140lock (\[$@%*])
59b085e1 141log (_)
604022a7 142lstat undef
95f7e41f 143lt undef
c0222185
RGS
144m undef
145map undef
d116c547 146mkdir (_;$)
c0222185
RGS
147msgctl ($$$)
148msgget ($$)
149msgrcv ($$$$$)
150msgsnd ($$$)
151my undef
95f7e41f 152ne undef
c0222185
RGS
153next undef
154no undef
155not ($)
59b085e1 156oct (_)
c0222185
RGS
157open (*;$@)
158opendir (*$)
95f7e41f 159or undef
59b085e1 160ord (_)
c0222185
RGS
161our undef
162pack ($@)
163package undef
164pipe (**)
cba5a3b0 165pop (;+)
c0222185
RGS
166pos undef
167print undef
168printf undef
169prototype undef
cba5a3b0 170push (+@)
c0222185
RGS
171q undef
172qq undef
173qr undef
59b085e1 174quotemeta (_)
c0222185
RGS
175qw undef
176qx undef
177rand (;$)
178read (*\$$;$)
179readdir (*)
180readline (;*)
59b085e1 181readlink (_)
01f5bc1b 182readpipe (_)
c0222185
RGS
183recv (*\$$$)
184redo undef
59b085e1 185ref (_)
c0222185
RGS
186rename ($$)
187require undef
188reset (;$)
189return undef
190reverse (@)
191rewinddir (*)
192rindex ($$;$)
59b085e1 193rmdir (_)
c0222185 194s undef
e3e804c9 195say undef
c0222185
RGS
196scalar undef
197seek (*$$)
198seekdir (*$)
199select (;*)
200semctl ($$$$)
201semget ($$$)
202semop ($$)
203send (*$$;$)
204setgrent ()
205sethostent ($)
206setnetent ($)
bdf1bb36 207setpgrp (;$$)
c0222185
RGS
208setpriority ($$$)
209setprotoent ($)
210setpwent ()
211setservent ($)
212setsockopt (*$$$)
cba5a3b0 213shift (;+)
c0222185
RGS
214shmctl ($$$)
215shmget ($$$)
216shmread ($$$$)
217shmwrite ($$$$)
218shutdown (*$)
59b085e1 219sin (_)
c0222185
RGS
220sleep (;$)
221socket (*$$$)
222socketpair (**$$$)
223sort undef
cba5a3b0 224splice (+;$$@)
c0222185
RGS
225split undef
226sprintf ($@)
59b085e1 227sqrt (_)
c0222185 228srand (;$)
604022a7 229stat undef
5458a98a 230state undef
c0222185
RGS
231study undef
232sub undef
233substr ($$;$$)
234symlink ($$)
235syscall ($@)
236sysopen (*$$;$)
237sysread (*\$$;$)
238sysseek (*$$)
239system undef
240syswrite (*$;$$)
241tell (;*)
242telldir (*)
1db4d195
FC
243tie (\[$@%*]$@)
244tied (\[$@%*])
c0222185
RGS
245time ()
246times ()
247tr undef
248truncate ($$)
59b085e1
RGS
249uc (_)
250ucfirst (_)
c0222185
RGS
251umask (;$)
252undef undef
253unless undef
254unlink (@)
255unpack ($;$)
cba5a3b0 256unshift (+@)
1db4d195 257untie (\[$@%*])
c0222185
RGS
258until undef
259use undef
260utime (@)
cba5a3b0 261values (+)
c0222185
RGS
262vec ($$$)
263wait ()
264waitpid ($$)
265wantarray ()
266warn (@)
5458a98a 267when undef
c0222185
RGS
268while undef
269write (;*)
95f7e41f
FC
270x undef
271xor undef
c0222185 272y undef