summaryrefslogtreecommitdiff
path: root/test/test_writefile_function.vader
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /test/test_writefile_function.vader
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
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