summaryrefslogtreecommitdiff
path: root/test/test_writefile_function.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-09-19 19:28:41 +0100
committerw0rp <devw0rp@gmail.com>2018-09-19 19:28:57 +0100
commita6c6e24d61c3d67f46cb9e3d5a8d4c8475b8a8c6 (patch)
tree158a8f25b2b8898bda47675c6791b0f62ccfdd67 /test/test_writefile_function.vader
parent9d50a06d489ddee8fa60b711f302ae83a25fb4d5 (diff)
downloadale-a6c6e24d61c3d67f46cb9e3d5a8d4c8475b8a8c6.zip
#1872 Remove extra carriage returns when fixing files on Windows
Diffstat (limited to 'test/test_writefile_function.vader')
-rw-r--r--test/test_writefile_function.vader21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/test_writefile_function.vader b/test/test_writefile_function.vader
index 4e4aab53..8c8a6f17 100644
--- a/test/test_writefile_function.vader
+++ b/test/test_writefile_function.vader
@@ -28,7 +28,26 @@ Execute(Carriage returns should be included for ale#util#Writefile):
AssertEqual
\ ["first\r", "second\r", "third\r", ''],
\ readfile('.newline-test', 'b')
- \
+
+Given(A file with extra carriage returns):
+ first
+ second
+ third
+ fourth
+
+Execute(Carriage returns should be de-depulicated):
+ call ale#test#SetFilename('.newline-test')
+
+ setlocal buftype=
+ noautocmd :w
+ noautocmd :e! ++ff=dos
+
+ call ale#util#Writefile(bufnr(''), getline(1, '$'), '.newline-test')
+
+ AssertEqual
+ \ ["first\r", "second\r", "third\r", "fourth\r", ''],
+ \ readfile('.newline-test', 'b')
+
Given(A file with Unix line ending characters):
first
second