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