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