about summary refs log tree commit diff
path: root/t/4500-mflow.t
blob: 879d6d4d25a88d2ab41052bba8752cb4756ef441 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/sh -e
cd ${0%/*}
. ./lib.sh
plan 12

rm -rf test.dir
mkdir test.dir
(
cd test.dir

export PIPE_CONTENTTYPE='text/plain; format=flowed'
export COLUMNS=80

cat <<! >a
this 
is 
flowed.
!
cat <<! >b
this is flowed.
!
check 'simple reflow' 'mflow <a | cmp - b'

cat <<! >a
this 
is  
two spaces.
!
cat <<! >b
this is  two spaces.
!
check 'simple space stuffing' 'mflow <a | cmp - b'

cat <<! >a
this 
is 
flowed.
this is fixed.
!
cat <<! >b
this is flowed.
this is fixed.
!
check 'simple fixed' 'mflow <a | cmp - b'

cat <<! >a
> this 
> is 
> quoted.
this 
is 
unquoted.
!
cat <<! >b
> this is quoted.
this is unquoted.
!
check 'simple quoted' 'mflow <a | cmp - b'

(
export PIPE_CONTENTTYPE='text/plain; format=flowed; delsp=yes'

cat <<! >a
> this 
> is 
> delsp.

> double  
> spaced
!
cat <<! >b
> thisisdelsp.

> double spaced
!
check 'simple delsp' 'mflow <a | cmp - b'
)

cat <<! >a
this 
is 
way more than eighty chars which is the terminal width to flow. 
this 
is 
way more than eighty chars which is the terminal width to flow. 
!
cat <<! >b
this is way more than eighty chars which is the terminal width to flow. this is
way more than eighty chars which is the terminal width to flow. 
!
check 'simple wrap' 'mflow <a | cmp - b'

cat <<! >a
this 
is 
way more than eighty chars which is the terminal width to flow. 
averylongwordcomeshere. 
this 
is 
way more than eighty chars which is the terminal width to flow.
!
cat <<! >b
this is way more than eighty chars which is the terminal width to flow. 
averylongwordcomeshere. this is way more than eighty chars which is the
terminal width to flow.
!
check 'more complex wrap' 'mflow <a | cmp - b'

cat <<! >a
foo 
bar. 

quux.
!
cat <<! >b
foo bar. 

quux.
!
check 'space before empty line' 'mflow <a | cmp - b'

cat <<! >a
Aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee 
aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee 
aaaaa bbbbb ccccc 
ffffff gggggg hhhhhh iiiiii.
!
cat <<! >b
Aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc
ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ffffff gggggg
hhhhhh iiiiii.
!
check 'fixed lines are wrapped too' 'mflow <a | cmp - b'

cat <<! >a
some 
wrapped. 
-- 
signature
!
cat <<! >b
some wrapped. 
-- 
signature
!
check 'passes usenet signature marker as is' 'mflow <a | cmp - b'

cat <<! >a
some regular text being force wrapped because the line is way too long oh no who writes so long lines.
!
cat <<! >b
some regular text being force wrapped because the line is way too long oh no
who writes so long lines.
!
check 'force wrapping' 'mflow -f <a | cmp - b'

cat <<! >a
> some regular text being force wrapped because the line is way too long oh no who writes so long lines.
!
cat <<! >b
> some regular text being force wrapped because the line is way too long oh no
> who writes so long lines.
!
check 'force wrapping of quoted text' 'mflow -f <a | cmp - b'

)