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