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