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