6933
|
1 Tests for 'fixeol' vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
4 :" first write two test files – with and without trailing EOL
|
|
5 :" use Unix fileformat for consistency
|
|
6 :set ff=unix
|
|
7 :enew!
|
|
8 awith eol:w! XXEol
|
|
9 :enew!
|
|
10 :set noeol nofixeol
|
|
11 awithout eol:w! XXNoEol
|
|
12 :set eol fixeol
|
|
13 :bwipe XXEol XXNoEol
|
|
14 :"
|
|
15 :" try editing files with 'fixeol' disabled
|
|
16 :e! XXEol
|
|
17 ostays eol:set nofixeol
|
|
18 :w! XXTestEol
|
|
19 :e! XXNoEol
|
|
20 ostays without:set nofixeol
|
|
21 :w! XXTestNoEol
|
|
22 :bwipe XXEol XXNoEol XXTestEol XXTestNoEol
|
|
23 :set fixeol
|
|
24 :"
|
|
25 :" Append "END" to each file so that we can see what the last written char was.
|
|
26 ggdGaEND:w >>XXEol
|
|
27 :w >>XXNoEol
|
|
28 :w >>XXTestEol
|
|
29 :w >>XXTestNoEol
|
|
30 :"
|
|
31 :" Concatenate the results
|
|
32 :e! test.out
|
|
33 a0:$r XXEol
|
|
34 :$r XXNoEol
|
|
35 Go1:$r XXTestEol
|
|
36 :$r XXTestNoEol
|
|
37 :w
|
|
38 :qa!
|
|
39 ENDTEST
|
|
40
|