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