xref: /openbsd/gnu/usr.bin/perl/t/op/cproto.t (revision 891d7ab6)
1#!./perl
2# Tests to ensure that we don't unexpectedly change prototypes of builtins
3
4BEGIN {
5    chdir 't' if -d 't';
6    @INC = '../lib';
7}
8
9BEGIN { require './test.pl'; }
10plan tests => 237;
11
12while (<DATA>) {
13    chomp;
14    (my $keyword, my $proto, local $TODO) = split " ", $_, 3;
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 (*$)
50continue ()
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 ($$)
71eval undef
72exec undef
73exists undef
74exit (;$)
75exp (_)
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 (*$$)
111given undef
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
140mkdir (_;$)
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 (_)
177recv (*\$$$)
178redo undef
179ref (_)
180rename ($$)
181require undef
182reset (;$)
183return undef
184reverse (@)
185rewinddir (*)
186rindex ($$;$)
187rmdir (_)
188s undef
189say undef
190scalar undef
191seek (*$$)
192seekdir (*$)
193select (;*)
194semctl ($$$$)
195semget ($$$)
196semop ($$)
197send (*$$;$)
198setgrent ()
199sethostent ($)
200setnetent ($)
201setpgrp (;$$)
202setpriority ($$$)
203setprotoent ($)
204setpwent ()
205setservent ($)
206setsockopt (*$$$)
207shift (;\@)
208shmctl ($$$)
209shmget ($$$)
210shmread ($$$$)
211shmwrite ($$$$)
212shutdown (*$)
213sin (_)
214sleep (;$)
215socket (*$$$)
216socketpair (**$$$)
217sort undef
218splice (\@;$$@)
219split undef
220sprintf ($@)
221sqrt (_)
222srand (;$)
223stat (*)
224state undef
225study undef
226sub undef
227substr ($$;$$)
228symlink ($$)
229syscall ($@)
230sysopen (*$$;$)
231sysread (*\$$;$)
232sysseek (*$$)
233system undef
234syswrite (*$;$$)
235tell (;*)
236telldir (*)
237tie undef
238tied undef
239time ()
240times ()
241tr undef
242truncate ($$)
243uc (_)
244ucfirst (_)
245umask (;$)
246undef undef
247unless undef
248unlink (@)
249unpack ($;$)
250unshift (\@@)
251untie undef
252until undef
253use undef
254utime (@)
255values (\[@%])
256vec ($$$)
257wait ()
258waitpid ($$)
259wantarray ()
260warn (@)
261when undef
262while undef
263write (;*)
264x unknown
265xor ($$)
266y undef
267