Commit | Line | Data |
---|---|---|
a687059c LW |
1 | #!./perl |
2 | ||
3 | # $Header: op.write,v 3.0 89/10/18 15:32:16 lwall Locked $ | |
4 | ||
5 | print "1..2\n"; | |
6 | ||
7 | format OUT = | |
8 | the quick brown @<< | |
9 | $fox | |
10 | jumped | |
11 | @* | |
12 | $multiline | |
13 | ^<<<<<<<<< | |
14 | $foo | |
15 | ^<<<<<<<<< | |
16 | $foo | |
17 | ^<<<<<<... | |
18 | $foo | |
19 | now @<<the@>>>> for all@|||||men to come @<<<< | |
20 | 'i' . 's', "time\n", $good, 'to' | |
21 | . | |
22 | ||
23 | open(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'; | |
29 | write(OUT); | |
30 | close OUT; | |
31 | ||
32 | $right = | |
33 | "the quick brown fox | |
34 | jumped | |
35 | forescore | |
36 | and | |
37 | seven years | |
38 | when in | |
39 | the course | |
40 | of huma... | |
41 | now is the time for all good men to come to\n"; | |
42 | ||
43 | if (`cat Op.write.tmp` eq $right) | |
44 | { print "ok 1\n"; unlink 'Op.write.tmp'; } | |
45 | else | |
46 | { print "not ok 1\n"; } | |
47 | ||
48 | format OUT2 = | |
49 | the quick brown @<< | |
50 | $fox | |
51 | jumped | |
52 | @* | |
53 | $multiline | |
54 | ^<<<<<<<<< ~~ | |
55 | $foo | |
56 | now @<<the@>>>> for all@|||||men to come @<<<< | |
57 | 'i' . 's', "time\n", $good, 'to' | |
58 | . | |
59 | ||
60 | open(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'; | |
66 | write(OUT2); | |
67 | close OUT2; | |
68 | ||
69 | $right = | |
70 | "the quick brown fox | |
71 | jumped | |
72 | forescore | |
73 | and | |
74 | seven years | |
75 | when in | |
76 | the course | |
77 | of human | |
78 | events it | |
79 | becomes | |
80 | necessary | |
81 | now is the time for all good men to come to\n"; | |
82 | ||
83 | if (`cat Op.write.tmp` eq $right) | |
84 | { print "ok 2\n"; unlink 'Op.write.tmp'; } | |
85 | else | |
86 | { print "not ok 2\n"; } | |
87 |