Mercurial > vim
annotate src/testdir/test30.in @ 8461:988ddc5742f5 v7.4.1521
commit https://github.com/vim/vim/commit/8322e1f06e8fa39a6bb790a7d8d7db5d7aff3366
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 8 19:20:04 2016 +0100
patch 7.4.1521
Problem: File permission test fails on MS-Windows.
Solution: Expect a different permission.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 08 Mar 2016 19:30:05 +0100 |
parents | 050e6df85f99 |
children | ae45d497868f |
rev | line source |
---|---|
7 | 1 Test for a lot of variations of the 'fileformats' option |
2 | |
1668 | 3 Note: This test will fail if "cat" is not available. |
4 | |
7 | 5 STARTTEST |
6 :so small.vim | |
7 :" first write three test files, one in each format | |
8 :set fileformat=unix | |
9 :set fileformats= | |
10 :/^unix/;/eof/-1w! XXUnix | |
11 :/^dos/;/eof/-1w! XXDos | |
12 :set bin noeol | |
13 :$w! XXMac | |
6635 | 14 Gonoeol |
15 :$w! XXEol | |
7 | 16 :set nobin eol |
6635 | 17 :enew! |
7 | 18 :bwipe XXUnix XXDos XXMac |
19 :" create mixed format files | |
1709 | 20 :if has("vms") |
21 : !copy XXUnix,XXDos XXUxDs. | |
22 : !copy XXUnix,XXMac XXUxMac. | |
23 : !copy XXDos,XXMac XXDosMac. | |
6635 | 24 : !copy XXMac,XXEol XXMacEol. |
1709 | 25 : !copy XXUnix,XXDos,XXMac XXUxDsMc. |
2485
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
1709
diff
changeset
|
26 :elseif has("win32") |
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
1709
diff
changeset
|
27 : !copy /b XXUnix+XXDos XXUxDs |
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
1709
diff
changeset
|
28 : !copy /b XXUnix+XXMac XXUxMac |
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
1709
diff
changeset
|
29 : !copy /b XXDos+XXMac XXDosMac |
6635 | 30 : !copy /b XXMac+XXEol XXMacEol |
2485
5edcd4ef88df
Small changes to the test files. (John Beckett)
Bram Moolenaar <bram@vim.org>
parents:
1709
diff
changeset
|
31 : !copy /b XXUnix+XXDos+XXMac XXUxDsMc |
1709 | 32 :else |
33 : !cat XXUnix XXDos >XXUxDs | |
34 : !cat XXUnix XXMac >XXUxMac | |
35 : !cat XXDos XXMac >XXDosMac | |
6635 | 36 : !cat XXMac XXEol >XXMacEol |
1709 | 37 : !cat XXUnix XXDos XXMac >XXUxDsMc |
38 :endif | |
7 | 39 :" |
40 :" try reading and writing with 'fileformats' empty | |
41 :set fileformat=unix | |
42 :e! XXUnix | |
43 :w! test.out | |
44 :e! XXDos | |
57 | 45 :w! XXtt01 |
7 | 46 :e! XXMac |
57 | 47 :w! XXtt02 |
7 | 48 :bwipe XXUnix XXDos XXMac |
49 :set fileformat=dos | |
50 :e! XXUnix | |
57 | 51 :w! XXtt11 |
7 | 52 :e! XXDos |
57 | 53 :w! XXtt12 |
7 | 54 :e! XXMac |
57 | 55 :w! XXtt13 |
7 | 56 :bwipe XXUnix XXDos XXMac |
57 :set fileformat=mac | |
58 :e! XXUnix | |
57 | 59 :w! XXtt21 |
7 | 60 :e! XXDos |
57 | 61 :w! XXtt22 |
7 | 62 :e! XXMac |
57 | 63 :w! XXtt23 |
7 | 64 :bwipe XXUnix XXDos XXMac |
65 :" | |
66 :" try reading and writing with 'fileformats' set to one format | |
67 :set fileformats=unix | |
68 :e! XXUxDsMc | |
57 | 69 :w! XXtt31 |
7 | 70 :bwipe XXUxDsMc |
71 :set fileformats=dos | |
72 :e! XXUxDsMc | |
57 | 73 :w! XXtt32 |
7 | 74 :bwipe XXUxDsMc |
75 :set fileformats=mac | |
76 :e! XXUxDsMc | |
57 | 77 :w! XXtt33 |
7 | 78 :bwipe XXUxDsMc |
79 :" | |
80 :" try reading and writing with 'fileformats' set to two formats | |
81 :set fileformats=unix,dos | |
82 :e! XXUxDsMc | |
57 | 83 :w! XXtt41 |
7 | 84 :bwipe XXUxDsMc |
85 :e! XXUxMac | |
57 | 86 :w! XXtt42 |
7 | 87 :bwipe XXUxMac |
88 :e! XXDosMac | |
57 | 89 :w! XXtt43 |
7 | 90 :bwipe XXDosMac |
91 :set fileformats=unix,mac | |
92 :e! XXUxDs | |
57 | 93 :w! XXtt51 |
7 | 94 :bwipe XXUxDs |
95 :e! XXUxDsMc | |
57 | 96 :w! XXtt52 |
7 | 97 :bwipe XXUxDsMc |
98 :e! XXDosMac | |
57 | 99 :w! XXtt53 |
7 | 100 :bwipe XXDosMac |
6635 | 101 :e! XXEol |
102 ggO=&ffs | |
103 :=&ff | |
104 :w! XXtt54 | |
105 :bwipe XXEol | |
7 | 106 :set fileformats=dos,mac |
107 :e! XXUxDs | |
57 | 108 :w! XXtt61 |
7 | 109 :bwipe XXUxDs |
110 :e! XXUxMac | |
6635 | 111 ggO=&ffs |
112 :=&ff | |
113 :w! XXtt62 | |
7 | 114 :bwipe XXUxMac |
115 :e! XXUxDsMc | |
57 | 116 :w! XXtt63 |
7 | 117 :bwipe XXUxDsMc |
6635 | 118 :e! XXMacEol |
119 ggO=&ffs | |
120 :=&ff | |
121 :w! XXtt64 | |
122 :bwipe XXMacEol | |
7 | 123 :" |
124 :" try reading and writing with 'fileformats' set to three formats | |
125 :set fileformats=unix,dos,mac | |
126 :e! XXUxDsMc | |
57 | 127 :w! XXtt71 |
7 | 128 :bwipe XXUxDsMc |
6635 | 129 :e! XXEol |
130 ggO=&ffs | |
131 :=&ff | |
132 :w! XXtt72 | |
133 :bwipe XXEol | |
7 | 134 :set fileformats=mac,dos,unix |
135 :e! XXUxDsMc | |
57 | 136 :w! XXtt81 |
7 | 137 :bwipe XXUxDsMc |
6635 | 138 :e! XXEol |
139 ggO=&ffs | |
140 :=&ff | |
141 :w! XXtt82 | |
142 :bwipe XXEol | |
7 | 143 :" try with 'binary' set |
144 :set fileformats=mac,unix,dos | |
145 :set binary | |
146 :e! XXUxDsMc | |
57 | 147 :w! XXtt91 |
7 | 148 :bwipe XXUxDsMc |
149 :set fileformats=mac | |
150 :e! XXUxDsMc | |
57 | 151 :w! XXtt92 |
7 | 152 :bwipe XXUxDsMc |
153 :set fileformats=dos | |
154 :e! XXUxDsMc | |
57 | 155 :w! XXtt93 |
156 :" | |
157 :" Append "END" to each file so that we can see what the last written char was. | |
158 :set fileformat=unix nobin | |
159 ggdGaEND:w >>XXtt01 | |
160 :w >>XXtt02 | |
161 :w >>XXtt11 | |
162 :w >>XXtt12 | |
163 :w >>XXtt13 | |
164 :w >>XXtt21 | |
165 :w >>XXtt22 | |
166 :w >>XXtt23 | |
167 :w >>XXtt31 | |
168 :w >>XXtt32 | |
169 :w >>XXtt33 | |
170 :w >>XXtt41 | |
171 :w >>XXtt42 | |
172 :w >>XXtt43 | |
173 :w >>XXtt51 | |
174 :w >>XXtt52 | |
175 :w >>XXtt53 | |
6635 | 176 :w >>XXtt54 |
57 | 177 :w >>XXtt61 |
178 :w >>XXtt62 | |
179 :w >>XXtt63 | |
6635 | 180 :w >>XXtt64 |
57 | 181 :w >>XXtt71 |
6635 | 182 :w >>XXtt72 |
57 | 183 :w >>XXtt81 |
6635 | 184 :w >>XXtt82 |
57 | 185 :w >>XXtt91 |
186 :w >>XXtt92 | |
187 :w >>XXtt93 | |
188 :" | |
189 :" Concatenate the results. | |
190 :" Make fileformat of test.out the native fileformat. | |
191 :" Add a newline at the end. | |
192 :set binary | |
193 :e! test.out | |
194 :$r XXtt01 | |
195 :$r XXtt02 | |
196 Go1:$r XXtt11 | |
197 :$r XXtt12 | |
198 :$r XXtt13 | |
199 Go2:$r XXtt21 | |
200 :$r XXtt22 | |
201 :$r XXtt23 | |
202 Go3:$r XXtt31 | |
203 :$r XXtt32 | |
204 :$r XXtt33 | |
205 Go4:$r XXtt41 | |
206 :$r XXtt42 | |
207 :$r XXtt43 | |
208 Go5:$r XXtt51 | |
209 :$r XXtt52 | |
210 :$r XXtt53 | |
6635 | 211 :$r XXtt54 |
57 | 212 Go6:$r XXtt61 |
213 :$r XXtt62 | |
214 :$r XXtt63 | |
6635 | 215 :$r XXtt64 |
57 | 216 Go7:$r XXtt71 |
6635 | 217 :$r XXtt72 |
57 | 218 Go8:$r XXtt81 |
6635 | 219 :$r XXtt82 |
57 | 220 Go9:$r XXtt91 |
221 :$r XXtt92 | |
222 :$r XXtt93 | |
223 Go10:$r XXUnix | |
224 :set nobinary ff& | |
225 :w | |
7 | 226 :qa! |
227 ENDTEST | |
228 | |
229 unix | |
230 unix | |
231 eof | |
232 | |
233 dos | |
234 dos | |
235 eof | |
236 | |
237 mac mac |