This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.000 patch.0o: [address] a few more Configure and build nits.
[perl5.git] / t / op / write.t
CommitLineData
a687059c
LW
1#!./perl
2
79072805 3# $RCSfile: write.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:38 $
a687059c 4
0f85fab0 5print "1..3\n";
a687059c
LW
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 @<<<<
a0d0e21e
LW
20{
21 'i' . 's', "time\n", $good, 'to'
22}
a687059c
LW
23.
24
a0d0e21e 25open(OUT, '>Op_write.tmp') || die "Can't create Op_write.tmp";
a687059c
LW
26
27$fox = 'foxiness';
28$good = 'good';
29$multiline = "forescore\nand\nseven years\n";
30$foo = 'when in the course of human events it becomes necessary';
31write(OUT);
32close OUT;
33
34$right =
35"the quick brown fox
36jumped
37forescore
38and
39seven years
40when in
41the course
42of huma...
43now is the time for all good men to come to\n";
44
a0d0e21e
LW
45if (`cat Op_write.tmp` eq $right)
46 { print "ok 1\n"; unlink 'Op_write.tmp'; }
a687059c
LW
47else
48 { print "not ok 1\n"; }
49
50format OUT2 =
51the quick brown @<<
52$fox
53jumped
54@*
55$multiline
56^<<<<<<<<< ~~
57$foo
58now @<<the@>>>> for all@|||||men to come @<<<<
59'i' . 's', "time\n", $good, 'to'
60.
61
a0d0e21e 62open OUT2, '>Op_write.tmp' or die "Can't create Op_write.tmp";
a687059c
LW
63
64$fox = 'foxiness';
65$good = 'good';
66$multiline = "forescore\nand\nseven years\n";
67$foo = 'when in the course of human events it becomes necessary';
68write(OUT2);
69close OUT2;
70
71$right =
72"the quick brown fox
73jumped
74forescore
75and
76seven years
77when in
78the course
79of human
80events it
81becomes
82necessary
83now is the time for all good men to come to\n";
84
a0d0e21e
LW
85if (`cat Op_write.tmp` eq $right)
86 { print "ok 2\n"; unlink 'Op_write.tmp'; }
a687059c
LW
87else
88 { print "not ok 2\n"; }
89
0f85fab0
LW
90eval <<'EOFORMAT';
91format OUT2 =
92the brown quick @<<
93$fox
94jumped
95@*
96$multiline
a0d0e21e 97and
0f85fab0
LW
98^<<<<<<<<< ~~
99$foo
100now @<<the@>>>> for all@|||||men to come @<<<<
101'i' . 's', "time\n", $good, 'to'
102.
103EOFORMAT
104
a0d0e21e 105open(OUT2, '>Op_write.tmp') || die "Can't create Op_write.tmp";
0f85fab0
LW
106
107$fox = 'foxiness';
108$good = 'good';
109$multiline = "forescore\nand\nseven years\n";
110$foo = 'when in the course of human events it becomes necessary';
111write(OUT2);
112close OUT2;
113
114$right =
115"the brown quick fox
116jumped
117forescore
118and
119seven years
a0d0e21e 120and
0f85fab0
LW
121when in
122the course
123of human
124events it
125becomes
126necessary
127now is the time for all good men to come to\n";
128
a0d0e21e
LW
129if (`cat Op_write.tmp` eq $right)
130 { print "ok 3\n"; unlink 'Op_write.tmp'; }
0f85fab0
LW
131else
132 { print "not ok 3\n"; }
133