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