All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#test#SetDirectory('/testplugin/test')
4 let g:new_line_test_file = tempname()
7 noautocmd :e! ++ff=unix
8 setlocal buftype=nofile
10 if filereadable(g:new_line_test_file)
11 call delete(g:new_line_test_file)
14 unlet! g:new_line_test_file
16 call ale#test#RestoreDirectory()
18 Given(A file with Windows line ending characters):
23 Execute(Carriage returns should be included for ale#util#Writefile):
24 call ale#test#SetFilename(g:new_line_test_file)
28 noautocmd :e! ++ff=dos
30 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
33 \ ["first\r", "second\r", "third\r", ''],
34 \ readfile(g:new_line_test_file, 'b')
36 Given(A file with extra carriage returns):
42 Execute(Carriage returns should be de-depulicated):
43 call ale#test#SetFilename(g:new_line_test_file)
47 noautocmd :e! ++ff=dos
49 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
52 \ ["first\r", "second\r", "third\r", "fourth\r", ''],
53 \ readfile(g:new_line_test_file, 'b')
55 Given(A file with Unix line ending characters):
60 Execute(Unix file lines should be written as normal):
61 call ale#test#SetFilename(g:new_line_test_file)
65 noautocmd :e! ++ff=unix
67 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
70 \ ['first', 'second', 'third', ''],
71 \ readfile(g:new_line_test_file, 'b')
73 Execute(Newline at end of file should be preserved even when nofixeol):
74 call ale#test#SetFilename(g:new_line_test_file)
78 noautocmd :e! ++ff=unix
82 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
85 \ ['first', 'second', 'third', ''],
86 \ readfile(g:new_line_test_file, 'b')
88 Execute(Newline should not be appended on write when noeol and nofixeol):
89 call ale#test#SetFilename(g:new_line_test_file)
93 noautocmd :e! ++ff=unix
97 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
100 \ ['first', 'second', 'third'],
101 \ readfile(g:new_line_test_file, 'b')
103 Execute(Newline should be appended on write when noeol and fixeol):
104 call ale#test#SetFilename(g:new_line_test_file)
108 noautocmd :e! ++ff=unix
112 call ale#util#Writefile(bufnr(''), getline(1, '$'), g:new_line_test_file)
115 \ ['first', 'second', 'third', ''],
116 \ readfile(g:new_line_test_file, 'b')