64-bit work. Now 32-bit platforms get a 100% make test
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / doio
CommitLineData
599cee73 1 doio.c AOK
2
3 Can't do bidirectional pipe
4 open(F, "| true |");
5
06eaf0bc 6 Missing command in piped open
7 open(F, "| ");
8
9 Missing command in piped open
10 open(F, " |");
11
599cee73 12 warn(warn_nl, "open");
13 open(F, "true\ncd")
14
15 Close on unopened file <%s>
16 $a = "fred";close($a)
17
18 tell() on unopened file
19 $a = "fred";$a = tell($a)
20
21 seek() on unopened file
22 $a = "fred";$a = seek($a,1,1)
23
24 sysseek() on unopened file
25 $a = "fred";$a = seek($a,1,1)
26
27 warn(warn_uninit);
28 print $a ;
29
30 Stat on unopened file <%s>
31 close STDIN ; -x STDIN ;
32
33 warn(warn_nl, "stat");
34 stat "ab\ncd"
35
36 warn(warn_nl, "lstat");
37 lstat "ab\ncd"
38
39 Can't exec \"%s\": %s
40
41 Can't exec \"%s\": %s
42
43
0453d815 44 Mandatory Warnings ALL TODO
45 ------------------
46 Can't do inplace edit: %s is not a regular file
47 edit a directory
48
49 Can't do inplace edit: %s would not be unique
50 Can't rename %s to %s: %s, skipping file
51 Can't rename %s to %s: %s, skipping file
52 Can't remove %s: %s, skipping file
53 Can't do inplace edit on %s: %s
54
55
599cee73 56__END__
57# doio.c
58use warning 'io' ;
3eeba6fb 59open(F, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|");
60close(F);
0453d815 61no warning 'io' ;
62open(G, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|");
63close(G);
599cee73 64EXPECT
65Can't do bidirectional pipe at - line 3.
66########
67# doio.c
68use warning 'io' ;
0453d815 69open(F, "| ");
70no warning 'io' ;
71open(G, "| ");
06eaf0bc 72EXPECT
73Missing command in piped open at - line 3.
74########
75# doio.c
76use warning 'io' ;
0453d815 77open(F, " |");
78no warning 'io' ;
79open(G, " |");
06eaf0bc 80EXPECT
81Missing command in piped open at - line 3.
82########
83# doio.c
84use warning 'io' ;
0453d815 85open(F, "<true\ncd");
86no warning 'io' ;
87open(G, "<true\ncd");
599cee73 88EXPECT
89Unsuccessful open on filename containing newline at - line 3.
90########
91# doio.c
92use warning 'io' ;
93close STDIN ;
94tell(STDIN);
95$a = seek(STDIN,1,1);
96$a = sysseek(STDIN,1,1);
97-x STDIN ;
0453d815 98no warning 'io' ;
99close STDIN ;
100tell(STDIN);
101$a = seek(STDIN,1,1);
102$a = sysseek(STDIN,1,1);
103-x STDIN ;
599cee73 104EXPECT
105tell() on unopened file at - line 4.
106seek() on unopened file at - line 5.
107sysseek() on unopened file at - line 6.
108Stat on unopened file <STDIN> at - line 7.
109########
110# doio.c
111use warning 'uninitialized' ;
112print $a ;
0453d815 113no warning 'uninitialized' ;
114print $b ;
599cee73 115EXPECT
116Use of uninitialized value at - line 3.
117########
118# doio.c
119use warning 'io' ;
120
121EXPECT
122
123########
124# doio.c
125use warning 'io' ;
126stat "ab\ncd";
127lstat "ab\ncd";
0453d815 128no warning 'io' ;
129stat "ab\ncd";
130lstat "ab\ncd";
599cee73 131EXPECT
132Unsuccessful stat on filename containing newline at - line 3.
133Unsuccessful stat on filename containing newline at - line 4.
134########
135# doio.c
136use warning 'io' ;
dfe13c55 137exec "lskdjfalksdjfdjfkls","" ;
0453d815 138no warning 'io' ;
139exec "lskdjfalksdjfdjfkls","" ;
599cee73 140EXPECT
e5e1b98b 141OPTION regex
c4f6c246 142Can't exec "lskdjfalksdjfdjfkls": .+
599cee73 143########
144# doio.c
145use warning 'io' ;
146exec "lskdjfalksdjfdjfkls", "abc" ;
0453d815 147no warning 'io' ;
148exec "lskdjfalksdjfdjfkls", "abc" ;
599cee73 149EXPECT
e5e1b98b 150OPTION regex
3eeba6fb 151Can't exec "lskdjfalksdjfdjfkls(:? abc)?": .+
0453d815 152########
153# doio.c
154$^W = 0 ;
155my $filename = "./temp" ;
156mkdir $filename, 0777
157 or die "Cannot create directory $filename: $!\n" ;
158{
159 local (@ARGV) = ($filename) ;
160 local ($^I) = "" ;
161 my $x = <> ;
162}
163{
164 no warning 'inplace' ;
165 local (@ARGV) = ($filename) ;
166 local ($^I) = "" ;
167 my $x = <> ;
168}
169{
170 use warning 'inplace' ;
171 local (@ARGV) = ($filename) ;
172 local ($^I) = "" ;
173 my $x = <> ;
174}
175rmdir $filename ;
176EXPECT
177Can't do inplace edit: ./temp is not a regular file at - line 9.
178Can't do inplace edit: ./temp is not a regular file at - line 21.
179