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