Commit | Line | Data |
599cee73 |
1 | pp_sys.c AOK |
2 | |
767a6a26 |
3 | untie attempted while %d inner references still exist [pp_untie] |
599cee73 |
4 | sub TIESCALAR { bless [] } ; tie $a, 'main'; untie $a ; |
5 | |
767a6a26 |
6 | Filehandle %s opened only for input [pp_leavewrite] |
599cee73 |
7 | format STDIN = |
8 | . |
9 | write STDIN; |
10 | |
9a7dcd9c |
11 | write() on closed filehandle %s [pp_leavewrite] |
599cee73 |
12 | format STDIN = |
13 | . |
14 | close STDIN; |
15 | write STDIN ; |
16 | |
767a6a26 |
17 | page overflow [pp_leavewrite] |
599cee73 |
18 | |
767a6a26 |
19 | Filehandle %s never opened [pp_prtf] |
599cee73 |
20 | $a = "abc"; printf $a "fred" |
21 | |
767a6a26 |
22 | Filehandle %s opened only for input [pp_prtf] |
599cee73 |
23 | $a = "abc"; |
24 | printf $a "fred" |
25 | |
9a7dcd9c |
26 | printf() on closed filehandle %s [pp_prtf] |
599cee73 |
27 | close STDIN ; |
28 | printf STDIN "fred" |
29 | |
9a7dcd9c |
30 | syswrite() on closed filehandle [pp_send] |
599cee73 |
31 | close STDIN; |
32 | syswrite STDIN, "fred", 1; |
33 | |
9a7dcd9c |
34 | send() on closed socket [pp_send] |
599cee73 |
35 | close STDIN; |
36 | send STDIN, "fred", 1 |
37 | |
9a7dcd9c |
38 | bind() on closed socket [pp_bind] |
599cee73 |
39 | close STDIN; |
40 | bind STDIN, "fred" ; |
41 | |
42 | |
9a7dcd9c |
43 | connect() on closed socket [pp_connect] |
599cee73 |
44 | close STDIN; |
45 | connect STDIN, "fred" ; |
46 | |
9a7dcd9c |
47 | listen() on closed socket [pp_listen] |
599cee73 |
48 | close STDIN; |
49 | listen STDIN, 2; |
50 | |
9a7dcd9c |
51 | accept() on closed socket [pp_accept] |
599cee73 |
52 | close STDIN; |
53 | accept STDIN, "fred" ; |
54 | |
9a7dcd9c |
55 | shutdown() on closed socket [pp_shutdown] |
599cee73 |
56 | close STDIN; |
57 | shutdown STDIN, 0; |
58 | |
9a7dcd9c |
59 | setsockopt() on closed socket [pp_ssockopt] |
60 | getsockopt() on closed socket [pp_ssockopt] |
599cee73 |
61 | close STDIN; |
62 | setsockopt STDIN, 1,2,3; |
63 | getsockopt STDIN, 1,2; |
64 | |
9a7dcd9c |
65 | getsockname() on closed socket [pp_getpeername] |
66 | getpeername() on closed socket [pp_getpeername] |
599cee73 |
67 | close STDIN; |
68 | getsockname STDIN; |
69 | getpeername STDIN; |
70 | |
767a6a26 |
71 | warn(warn_nl, "stat"); [pp_stat] |
599cee73 |
72 | |
73 | Test on unopened file <%s> |
74 | close STDIN ; -T STDIN ; |
75 | |
767a6a26 |
76 | warn(warn_nl, "open"); [pp_fttext] |
599cee73 |
77 | -T "abc\ndef" ; |
78 | |
767a6a26 |
79 | Filehandle %s opened only for output [pp_sysread] |
80 | my $file = "./xcv" ; |
81 | open(F, ">$file") ; |
82 | my $a = sysread(F, $a,10) ; |
83 | |
599cee73 |
84 | |
85 | |
86 | __END__ |
767a6a26 |
87 | # pp_sys.c [pp_untie] |
4438c4b7 |
88 | use warnings 'untie' ; |
599cee73 |
89 | sub TIESCALAR { bless [] } ; |
90 | $b = tie $a, 'main'; |
91 | untie $a ; |
4438c4b7 |
92 | no warnings 'untie' ; |
0453d815 |
93 | $c = tie $d, 'main'; |
94 | untie $d ; |
599cee73 |
95 | EXPECT |
96 | untie attempted while 1 inner references still exist at - line 5. |
97 | ######## |
767a6a26 |
98 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
99 | use warnings 'io' ; |
599cee73 |
100 | format STDIN = |
101 | . |
102 | write STDIN; |
4438c4b7 |
103 | no warnings 'io' ; |
0453d815 |
104 | write STDIN; |
599cee73 |
105 | EXPECT |
af8c498a |
106 | Filehandle main::STDIN opened only for input at - line 5. |
599cee73 |
107 | ######## |
767a6a26 |
108 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
109 | use warnings 'closed' ; |
599cee73 |
110 | format STDIN = |
111 | . |
112 | close STDIN; |
113 | write STDIN; |
4438c4b7 |
114 | no warnings 'closed' ; |
0453d815 |
115 | write STDIN; |
599cee73 |
116 | EXPECT |
9a7dcd9c |
117 | write() on closed filehandle main::STDIN at - line 6. |
599cee73 |
118 | ######## |
767a6a26 |
119 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
120 | use warnings 'io' ; |
599cee73 |
121 | format STDOUT_TOP = |
122 | abc |
123 | . |
124 | format STDOUT = |
125 | def |
126 | ghi |
127 | . |
128 | $= = 1 ; |
129 | $- =1 ; |
3eeba6fb |
130 | open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ; |
599cee73 |
131 | write ; |
4438c4b7 |
132 | no warnings 'io' ; |
0453d815 |
133 | write ; |
599cee73 |
134 | EXPECT |
135 | page overflow at - line 13. |
136 | ######## |
767a6a26 |
137 | # pp_sys.c [pp_prtf] |
4438c4b7 |
138 | use warnings 'unopened' ; |
599cee73 |
139 | $a = "abc"; |
0453d815 |
140 | printf $a "fred"; |
4438c4b7 |
141 | no warnings 'unopened' ; |
0453d815 |
142 | printf $a "fred"; |
599cee73 |
143 | EXPECT |
144 | Filehandle main::abc never opened at - line 4. |
145 | ######## |
767a6a26 |
146 | # pp_sys.c [pp_prtf] |
4438c4b7 |
147 | use warnings 'closed' ; |
599cee73 |
148 | close STDIN ; |
0453d815 |
149 | printf STDIN "fred"; |
4438c4b7 |
150 | no warnings 'closed' ; |
0453d815 |
151 | printf STDIN "fred"; |
599cee73 |
152 | EXPECT |
9a7dcd9c |
153 | printf() on closed filehandle main::STDIN at - line 4. |
599cee73 |
154 | ######## |
767a6a26 |
155 | # pp_sys.c [pp_prtf] |
4438c4b7 |
156 | use warnings 'io' ; |
0453d815 |
157 | printf STDIN "fred"; |
4438c4b7 |
158 | no warnings 'io' ; |
0453d815 |
159 | printf STDIN "fred"; |
599cee73 |
160 | EXPECT |
161 | Filehandle main::STDIN opened only for input at - line 3. |
162 | ######## |
767a6a26 |
163 | # pp_sys.c [pp_send] |
4438c4b7 |
164 | use warnings 'closed' ; |
599cee73 |
165 | close STDIN; |
166 | syswrite STDIN, "fred", 1; |
4438c4b7 |
167 | no warnings 'closed' ; |
0453d815 |
168 | syswrite STDIN, "fred", 1; |
599cee73 |
169 | EXPECT |
9a7dcd9c |
170 | syswrite() on closed filehandle at - line 4. |
599cee73 |
171 | ######## |
767a6a26 |
172 | # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] |
4438c4b7 |
173 | use warnings 'io' ; |
599cee73 |
174 | use Config; |
175 | BEGIN { |
176 | if ( $^O ne 'VMS' and ! $Config{d_socket}) { |
177 | print <<EOM ; |
178 | SKIPPED |
179 | # send not present |
180 | # bind not present |
181 | # connect not present |
182 | # accept not present |
183 | # shutdown not present |
184 | # setsockopt not present |
185 | # getsockopt not present |
186 | # getsockname not present |
187 | # getpeername not present |
188 | EOM |
189 | exit ; |
190 | } |
191 | } |
192 | close STDIN; |
193 | send STDIN, "fred", 1; |
194 | bind STDIN, "fred" ; |
195 | connect STDIN, "fred" ; |
196 | listen STDIN, 2; |
197 | accept STDIN, "fred" ; |
198 | shutdown STDIN, 0; |
199 | setsockopt STDIN, 1,2,3; |
200 | getsockopt STDIN, 1,2; |
201 | getsockname STDIN; |
202 | getpeername STDIN; |
4438c4b7 |
203 | no warnings 'io' ; |
0453d815 |
204 | send STDIN, "fred", 1; |
205 | bind STDIN, "fred" ; |
206 | connect STDIN, "fred" ; |
207 | listen STDIN, 2; |
208 | accept STDIN, "fred" ; |
209 | shutdown STDIN, 0; |
210 | setsockopt STDIN, 1,2,3; |
211 | getsockopt STDIN, 1,2; |
212 | getsockname STDIN; |
213 | getpeername STDIN; |
599cee73 |
214 | EXPECT |
9a7dcd9c |
215 | send() on closed socket at - line 22. |
216 | bind() on closed socket at - line 23. |
217 | connect() on closed socket at - line 24. |
218 | listen() on closed socket at - line 25. |
219 | accept() on closed socket at - line 26. |
220 | shutdown() on closed socket at - line 27. |
221 | setsockopt() on closed socket at - line 28. |
222 | getsockopt() on closed socket at - line 29. |
223 | getsockname() on closed socket at - line 30. |
224 | getpeername() on closed socket at - line 31. |
599cee73 |
225 | ######## |
767a6a26 |
226 | # pp_sys.c [pp_stat] |
4438c4b7 |
227 | use warnings 'newline' ; |
599cee73 |
228 | stat "abc\ndef"; |
4438c4b7 |
229 | no warnings 'newline' ; |
0453d815 |
230 | stat "abc\ndef"; |
599cee73 |
231 | EXPECT |
232 | Unsuccessful stat on filename containing newline at - line 3. |
233 | ######## |
767a6a26 |
234 | # pp_sys.c [pp_fttext] |
4438c4b7 |
235 | use warnings 'unopened' ; |
599cee73 |
236 | close STDIN ; |
237 | -T STDIN ; |
4438c4b7 |
238 | no warnings 'unopened' ; |
0453d815 |
239 | -T STDIN ; |
599cee73 |
240 | EXPECT |
241 | Test on unopened file <STDIN> at - line 4. |
242 | ######## |
767a6a26 |
243 | # pp_sys.c [pp_fttext] |
4438c4b7 |
244 | use warnings 'newline' ; |
599cee73 |
245 | -T "abc\ndef" ; |
4438c4b7 |
246 | no warnings 'newline' ; |
0453d815 |
247 | -T "abc\ndef" ; |
599cee73 |
248 | EXPECT |
249 | Unsuccessful open on filename containing newline at - line 3. |
767a6a26 |
250 | ######## |
251 | # pp_sys.c [pp_sysread] |
252 | use warnings 'io' ; |
253 | my $file = "./xcv" ; |
254 | open(F, ">$file") ; |
255 | my $a = sysread(F, $a,10) ; |
256 | no warnings 'io' ; |
257 | my $a = sysread(F, $a,10) ; |
258 | close F ; |
259 | unlink $file ; |
260 | EXPECT |
261 | Filehandle main::F opened only for output at - line 5. |