Merged from the latest developing branch.
[MacVim.git] / src / testdir / test30.in
blob9d9b89b3cfbd39199a92613d4657f1fc8aa7b079
1 Test for a lot of variations of the 'fileformats' option
3 STARTTEST
4 :so small.vim
5 :" first write three test files, one in each format
6 :set fileformat=unix
7 :set fileformats=
8 :/^1/w! XX1
9 :/^2/w! XX2
10 :/^3/w! XX3
11 :/^4/w! XX4
12 :/^5/w! XX5
13 :/^6/w! XX6
14 :/^7/w! XX7
15 :/^8/w! XX8
16 :/^9/w! XX9
17 :/^10/w! XX10
18 :/^unix/;/eof/-1w! XXUnix
19 :/^dos/;/eof/-1w! XXDos
20 :set bin noeol
21 :$w! XXMac
22 :set nobin eol
23 :bwipe XXUnix XXDos XXMac
24 :" create mixed format files
25 :!cat XXUnix XXDos >XXUxDs
26 :!cat XXUnix XXMac >XXUxMac
27 :!cat XXDos XXMac >XXDosMac
28 :!cat XXUnix XXDos XXMac >XXUxDsMc
30 :" try reading and writing with 'fileformats' empty
31 :set fileformat=unix
32 :e! XXUnix
33 :w! test.out
34 :e! XXDos
35 :w! XXtt01
36 :e! XXMac
37 :w! XXtt02
38 :bwipe XXUnix XXDos XXMac
39 :set fileformat=dos
40 :e! XXUnix
41 :w! XXtt11
42 :e! XXDos
43 :w! XXtt12
44 :e! XXMac
45 :w! XXtt13
46 :bwipe XXUnix XXDos XXMac
47 :set fileformat=mac
48 :e! XXUnix
49 :w! XXtt21
50 :e! XXDos
51 :w! XXtt22
52 :e! XXMac
53 :w! XXtt23
54 :bwipe XXUnix XXDos XXMac
56 :" try reading and writing with 'fileformats' set to one format
57 :set fileformats=unix
58 :e! XXUxDsMc
59 :w! XXtt31
60 :bwipe XXUxDsMc
61 :set fileformats=dos
62 :e! XXUxDsMc
63 :w! XXtt32
64 :bwipe XXUxDsMc
65 :set fileformats=mac
66 :e! XXUxDsMc
67 :w! XXtt33
68 :bwipe XXUxDsMc
70 :" try reading and writing with 'fileformats' set to two formats
71 :set fileformats=unix,dos
72 :e! XXUxDsMc
73 :w! XXtt41
74 :bwipe XXUxDsMc
75 :e! XXUxMac
76 :w! XXtt42
77 :bwipe XXUxMac
78 :e! XXDosMac
79 :w! XXtt43
80 :bwipe XXDosMac
81 :set fileformats=unix,mac
82 :e! XXUxDs
83 :w! XXtt51
84 :bwipe XXUxDs
85 :e! XXUxDsMc
86 :w! XXtt52
87 :bwipe XXUxDsMc
88 :e! XXDosMac
89 :w! XXtt53
90 :bwipe XXDosMac
91 :set fileformats=dos,mac
92 :e! XXUxDs
93 :w! XXtt61
94 :bwipe XXUxDs
95 :e! XXUxMac
96 :w! XXtt62
97 :bwipe XXUxMac
98 :e! XXUxDsMc
99 :w! XXtt63
100 :bwipe XXUxDsMc
102 :" try reading and writing with 'fileformats' set to three formats
103 :set fileformats=unix,dos,mac
104 :e! XXUxDsMc
105 :w! XXtt71
106 :bwipe XXUxDsMc
107 :set fileformats=mac,dos,unix
108 :e! XXUxDsMc
109 :w! XXtt81
110 :bwipe XXUxDsMc
111 :" try with 'binary' set
112 :set fileformats=mac,unix,dos
113 :set binary
114 :e! XXUxDsMc
115 :w! XXtt91
116 :bwipe XXUxDsMc
117 :set fileformats=mac
118 :e! XXUxDsMc
119 :w! XXtt92
120 :bwipe XXUxDsMc
121 :set fileformats=dos
122 :e! XXUxDsMc
123 :w! XXtt93
125 :" Append "END" to each file so that we can see what the last written char was.
126 :set fileformat=unix nobin
127 ggdGaEND\e:w >>XXtt01
128 :w >>XXtt02
129 :w >>XXtt11
130 :w >>XXtt12
131 :w >>XXtt13
132 :w >>XXtt21
133 :w >>XXtt22
134 :w >>XXtt23
135 :w >>XXtt31
136 :w >>XXtt32
137 :w >>XXtt33
138 :w >>XXtt41
139 :w >>XXtt42
140 :w >>XXtt43
141 :w >>XXtt51
142 :w >>XXtt52
143 :w >>XXtt53
144 :w >>XXtt61
145 :w >>XXtt62
146 :w >>XXtt63
147 :w >>XXtt71
148 :w >>XXtt81
149 :w >>XXtt91
150 :w >>XXtt92
151 :w >>XXtt93
153 :" Concatenate the results.
154 :" Make fileformat of test.out the native fileformat.
155 :" Add a newline at the end.
156 :set binary
157 :e! test.out
158 :$r XXtt01
159 :$r XXtt02
160 Go1\e:$r XXtt11
161 :$r XXtt12
162 :$r XXtt13
163 Go2\e:$r XXtt21
164 :$r XXtt22
165 :$r XXtt23
166 Go3\e:$r XXtt31
167 :$r XXtt32
168 :$r XXtt33
169 Go4\e:$r XXtt41
170 :$r XXtt42
171 :$r XXtt43
172 Go5\e:$r XXtt51
173 :$r XXtt52
174 :$r XXtt53
175 Go6\e:$r XXtt61
176 :$r XXtt62
177 :$r XXtt63
178 Go7\e:$r XXtt71
179 Go8\e:$r XXtt81
180 Go9\e:$r XXtt91
181 :$r XXtt92
182 :$r XXtt93
183 Go10\e:$r XXUnix
184 :set nobinary ff&
186 :qa!
187 ENDTEST
200 unix
201 unix
204 dos\r
205 dos\r
208 mac\rmac\r