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