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