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