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'; } |
f23102e2 | 10 | plan tests => 237; |
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 ($$) | |
c0222185 | 71 | eval undef |
72 | exec undef | |
73 | exists undef | |
74 | exit (;$) | |
59b085e1 | 75 | exp (_) |
c0222185 | 76 | fcntl (*$$) |
77 | fileno (*) | |
78 | flock (*$) | |
79 | for undef | |
80 | foreach undef | |
81 | fork () | |
82 | format undef | |
83 | formline ($@) | |
84 | ge ($$) | |
85 | getc (;*) | |
86 | getgrent () | |
87 | getgrgid ($) | |
88 | getgrnam ($) | |
89 | gethostbyaddr ($$) | |
90 | gethostbyname ($) | |
91 | gethostent () | |
92 | getlogin () | |
93 | getnetbyaddr ($$) | |
94 | getnetbyname ($) | |
95 | getnetent () | |
96 | getpeername (*) | |
97 | getpgrp (;$) | |
98 | getppid () | |
99 | getpriority ($$) | |
100 | getprotobyname ($) | |
101 | getprotobynumber ($) | |
102 | getprotoent () | |
103 | getpwent () | |
104 | getpwnam ($) | |
105 | getpwuid ($) | |
106 | getservbyname ($$) | |
107 | getservbyport ($$) | |
108 | getservent () | |
109 | getsockname (*) | |
110 | getsockopt (*$$) | |
5458a98a | 111 | given undef |
c0222185 | 112 | glob undef |
113 | gmtime (;$) | |
114 | goto undef | |
115 | grep undef | |
116 | gt ($$) | |
59b085e1 | 117 | hex (_) |
c0222185 | 118 | if undef |
119 | index ($$;$) | |
59b085e1 | 120 | int (_) |
c0222185 | 121 | ioctl (*$$) |
122 | join ($@) | |
123 | keys (\%) | |
124 | kill (@) | |
125 | last undef | |
59b085e1 | 126 | lc (_) |
127 | lcfirst (_) | |
c0222185 | 128 | le ($$) |
59b085e1 | 129 | length (_) |
c0222185 | 130 | link ($$) |
131 | listen (*$) | |
132 | local undef | |
133 | localtime (;$) | |
134 | lock (\$) | |
59b085e1 | 135 | log (_) |
c0222185 | 136 | lstat (*) |
137 | lt ($$) | |
138 | m undef | |
139 | map undef | |
d116c547 | 140 | mkdir (_;$) |
c0222185 | 141 | msgctl ($$$) |
142 | msgget ($$) | |
143 | msgrcv ($$$$$) | |
144 | msgsnd ($$$) | |
145 | my undef | |
146 | ne ($$) | |
147 | next undef | |
148 | no undef | |
149 | not ($) | |
59b085e1 | 150 | oct (_) |
c0222185 | 151 | open (*;$@) |
152 | opendir (*$) | |
153 | or () | |
59b085e1 | 154 | ord (_) |
c0222185 | 155 | our undef |
156 | pack ($@) | |
157 | package undef | |
158 | pipe (**) | |
159 | pop (;\@) | |
160 | pos undef | |
161 | print undef | |
162 | printf undef | |
163 | prototype undef | |
164 | push (\@@) | |
165 | q undef | |
166 | qq undef | |
167 | qr undef | |
59b085e1 | 168 | quotemeta (_) |
c0222185 | 169 | qw undef |
170 | qx undef | |
171 | rand (;$) | |
172 | read (*\$$;$) | |
173 | readdir (*) | |
174 | readline (;*) | |
59b085e1 | 175 | readlink (_) |
01f5bc1b | 176 | readpipe (_) |
c0222185 | 177 | recv (*\$$$) |
178 | redo undef | |
59b085e1 | 179 | ref (_) |
c0222185 | 180 | rename ($$) |
181 | require undef | |
182 | reset (;$) | |
183 | return undef | |
184 | reverse (@) | |
185 | rewinddir (*) | |
186 | rindex ($$;$) | |
59b085e1 | 187 | rmdir (_) |
c0222185 | 188 | s undef |
e3e804c9 | 189 | say undef |
c0222185 | 190 | scalar undef |
191 | seek (*$$) | |
192 | seekdir (*$) | |
193 | select (;*) | |
194 | semctl ($$$$) | |
195 | semget ($$$) | |
196 | semop ($$) | |
197 | send (*$$;$) | |
198 | setgrent () | |
199 | sethostent ($) | |
200 | setnetent ($) | |
bdf1bb36 | 201 | setpgrp (;$$) |
c0222185 | 202 | setpriority ($$$) |
203 | setprotoent ($) | |
204 | setpwent () | |
205 | setservent ($) | |
206 | setsockopt (*$$$) | |
207 | shift (;\@) | |
208 | shmctl ($$$) | |
209 | shmget ($$$) | |
210 | shmread ($$$$) | |
211 | shmwrite ($$$$) | |
212 | shutdown (*$) | |
59b085e1 | 213 | sin (_) |
c0222185 | 214 | sleep (;$) |
215 | socket (*$$$) | |
216 | socketpair (**$$$) | |
217 | sort undef | |
218 | splice (\@;$$@) | |
219 | split undef | |
220 | sprintf ($@) | |
59b085e1 | 221 | sqrt (_) |
c0222185 | 222 | srand (;$) |
223 | stat (*) | |
5458a98a | 224 | state undef |
c0222185 | 225 | study undef |
226 | sub undef | |
227 | substr ($$;$$) | |
228 | symlink ($$) | |
229 | syscall ($@) | |
230 | sysopen (*$$;$) | |
231 | sysread (*\$$;$) | |
232 | sysseek (*$$) | |
233 | system undef | |
234 | syswrite (*$;$$) | |
235 | tell (;*) | |
236 | telldir (*) | |
237 | tie undef | |
238 | tied undef | |
239 | time () | |
240 | times () | |
241 | tr undef | |
242 | truncate ($$) | |
59b085e1 | 243 | uc (_) |
244 | ucfirst (_) | |
c0222185 | 245 | umask (;$) |
246 | undef undef | |
247 | unless undef | |
248 | unlink (@) | |
249 | unpack ($;$) | |
250 | unshift (\@@) | |
251 | untie undef | |
252 | until undef | |
253 | use undef | |
254 | utime (@) | |
255 | values (\%) | |
256 | vec ($$$) | |
257 | wait () | |
258 | waitpid ($$) | |
259 | wantarray () | |
260 | warn (@) | |
5458a98a | 261 | when undef |
c0222185 | 262 | while undef |
263 | write (;*) | |
264 | x unknown | |
265 | xor ($$) | |
266 | y undef |