perl 4.0 patch 9: patch #4, continued
[p5sagit/p5-mst-13.2.git] / t / op / write.t
CommitLineData
a687059c 1#!./perl
2
fe14fcc3 3# $Header: write.t,v 4.0 91/03/20 01:55:34 lwall Locked $
a687059c 4
0f85fab0 5print "1..3\n";
a687059c 6
7format OUT =
8the quick brown @<<
9$fox
10jumped
11@*
12$multiline
13^<<<<<<<<<
14$foo
15^<<<<<<<<<
16$foo
17^<<<<<<...
18$foo
19now @<<the@>>>> for all@|||||men to come @<<<<
20'i' . 's', "time\n", $good, 'to'
21.
22
23open(OUT, '>Op.write.tmp') || die "Can't create Op.write.tmp";
24
25$fox = 'foxiness';
26$good = 'good';
27$multiline = "forescore\nand\nseven years\n";
28$foo = 'when in the course of human events it becomes necessary';
29write(OUT);
30close OUT;
31
32$right =
33"the quick brown fox
34jumped
35forescore
36and
37seven years
38when in
39the course
40of huma...
41now is the time for all good men to come to\n";
42
43if (`cat Op.write.tmp` eq $right)
44 { print "ok 1\n"; unlink 'Op.write.tmp'; }
45else
46 { print "not ok 1\n"; }
47
48format OUT2 =
49the quick brown @<<
50$fox
51jumped
52@*
53$multiline
54^<<<<<<<<< ~~
55$foo
56now @<<the@>>>> for all@|||||men to come @<<<<
57'i' . 's', "time\n", $good, 'to'
58.
59
60open(OUT2, '>Op.write.tmp') || die "Can't create Op.write.tmp";
61
62$fox = 'foxiness';
63$good = 'good';
64$multiline = "forescore\nand\nseven years\n";
65$foo = 'when in the course of human events it becomes necessary';
66write(OUT2);
67close OUT2;
68
69$right =
70"the quick brown fox
71jumped
72forescore
73and
74seven years
75when in
76the course
77of human
78events it
79becomes
80necessary
81now is the time for all good men to come to\n";
82
83if (`cat Op.write.tmp` eq $right)
84 { print "ok 2\n"; unlink 'Op.write.tmp'; }
85else
86 { print "not ok 2\n"; }
87
0f85fab0 88eval <<'EOFORMAT';
89format OUT2 =
90the brown quick @<<
91$fox
92jumped
93@*
94$multiline
95^<<<<<<<<< ~~
96$foo
97now @<<the@>>>> for all@|||||men to come @<<<<
98'i' . 's', "time\n", $good, 'to'
99.
100EOFORMAT
101
102open(OUT2, '>Op.write.tmp') || die "Can't create Op.write.tmp";
103
104$fox = 'foxiness';
105$good = 'good';
106$multiline = "forescore\nand\nseven years\n";
107$foo = 'when in the course of human events it becomes necessary';
108write(OUT2);
109close OUT2;
110
111$right =
112"the brown quick fox
113jumped
114forescore
115and
116seven years
117when in
118the course
119of human
120events it
121becomes
122necessary
123now is the time for all good men to come to\n";
124
125if (`cat Op.write.tmp` eq $right)
126 { print "ok 3\n"; unlink 'Op.write.tmp'; }
127else
128 { print "not ok 3\n"; }
129