blob: a881fb1b80f24df3ffc68cc46746202a16b9d759 [file] [log] [blame]
Bram Moolenaar34d72d42015-07-17 14:18:08 +02001Tests for 'fixeol' vim: set ft=vim :
2
3STARTTEST
4:" first write two test files – with and without trailing EOL
5:" use Unix fileformat for consistency
6:set ff=unix
7:enew!
8awith eol:w! XXEol
9:enew!
10:set noeol nofixeol
11awithout eol:w! XXNoEol
12:set eol fixeol
13:bwipe XXEol XXNoEol
14:"
15:" try editing files with 'fixeol' disabled
16:e! XXEol
17ostays eol:set nofixeol
18:w! XXTestEol
19:e! XXNoEol
20ostays 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.
26ggdGaEND:w >>XXEol
27:w >>XXNoEol
28:w >>XXTestEol
29:w >>XXTestNoEol
30:"
31:" Concatenate the results
32:e! test.out
33a0:$r XXEol
34:$r XXNoEol
35Go1:$r XXTestEol
36:$r XXTestNoEol
37:w
38:qa!
39ENDTEST
40