sanity check piped opens (tweaked version of patch suggested
[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
44__END__
45# doio.c
46use warning 'io' ;
dfe13c55 47open(F, "|$^X -e 1|")
599cee73 48EXPECT
49Can't do bidirectional pipe at - line 3.
50########
51# doio.c
52use warning 'io' ;
06eaf0bc 53open(F, "| ")
54EXPECT
55Missing command in piped open at - line 3.
56########
57# doio.c
58use warning 'io' ;
59open(F, " |")
60EXPECT
61Missing command in piped open at - line 3.
62########
63# doio.c
64use warning 'io' ;
599cee73 65open(F, "<true\ncd")
66EXPECT
67Unsuccessful open on filename containing newline at - line 3.
68########
69# doio.c
70use warning 'io' ;
71close STDIN ;
72tell(STDIN);
73$a = seek(STDIN,1,1);
74$a = sysseek(STDIN,1,1);
75-x STDIN ;
76EXPECT
77tell() on unopened file at - line 4.
78seek() on unopened file at - line 5.
79sysseek() on unopened file at - line 6.
80Stat on unopened file <STDIN> at - line 7.
81########
82# doio.c
83use warning 'uninitialized' ;
84print $a ;
85EXPECT
86Use of uninitialized value at - line 3.
87########
88# doio.c
89use warning 'io' ;
90
91EXPECT
92
93########
94# doio.c
95use warning 'io' ;
96stat "ab\ncd";
97lstat "ab\ncd";
98EXPECT
99Unsuccessful stat on filename containing newline at - line 3.
100Unsuccessful stat on filename containing newline at - line 4.
101########
102# doio.c
103use warning 'io' ;
dfe13c55 104exec "lskdjfalksdjfdjfkls","" ;
599cee73 105EXPECT
e5e1b98b 106OPTION regex
ee11c7bf 107Can't exec "lskdjfalksdjfdjfkls": (\w+ )?(No such file or directory|A file or directory in the path name does not exist)
599cee73 108########
109# doio.c
110use warning 'io' ;
111exec "lskdjfalksdjfdjfkls", "abc" ;
112EXPECT
e5e1b98b 113OPTION regex
ee11c7bf 114Can't exec "lskdjfalksdjfdjfkls": (\w+ )?(No such file or directory|A file or directory in the path name does not exist)