summaryrefslogtreecommitdiff
path: root/test/fix/test_ale_fix.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2020-09-08 21:40:10 +0100
committerw0rp <devw0rp@gmail.com>2020-09-08 21:40:10 +0100
commit7d90ff56d96d601478f00895e009ae63a7d8b4bb (patch)
tree8e20d801244d0571cc3680d2b6c42be3a342dadf /test/fix/test_ale_fix.vader
parentb4b75126f9eae30da8f5e0cb9ec100feb38c1cb6 (diff)
downloadale-7d90ff56d96d601478f00895e009ae63a7d8b4bb.zip
Close #3333 - Add an ALECompletePost event
Add an `ALECompletePost` event along with everything needed to make it useful for its primary purpose: fixing code after inserting completions. * `ALEFix` can now be called with a bang (`!`) to suppress errors. * A new `ALELintStop` command lets you stop linting, and start it later.
Diffstat (limited to 'test/fix/test_ale_fix.vader')
-rw-r--r--test/fix/test_ale_fix.vader24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader
index a51a5a53..128e3a14 100644
--- a/test/fix/test_ale_fix.vader
+++ b/test/fix/test_ale_fix.vader
@@ -196,6 +196,10 @@ After:
" Clear the messages between tests.
echomsg ''
+ if !exists('g:ale_command_wrapper')
+ let g:ale_command_wrapper = ''
+ endif
+
Given testft (A file with three lines):
a
b
@@ -206,6 +210,13 @@ Execute(ALEFix should complain when there are no functions to call):
call ale#test#FlushJobs()
AssertEqual 'No fixers have been defined. Try :ALEFixSuggest', GetLastMessage()
+Execute(ALEFix should not complain when the command is run with a bang):
+ echom 'none'
+
+ ALEFix!
+ call ale#test#FlushJobs()
+ AssertEqual 'none', GetLastMessage()
+
Execute(ALEFix should apply simple functions):
let g:ale_fixers.testft = ['AddCarets']
ALEFix
@@ -715,6 +726,19 @@ Execute(ale#fix#InitBufferData() should set up the correct data):
\ 'done': 0,
\ 'lines_before': ['a', 'b', 'c'],
\ 'should_save': 1,
+ \ 'ignore_file_changed_errors': 0,
+ \ },
+ \}, g:ale_fix_buffer_data
+
+ call ale#fix#InitBufferData(bufnr(''), '!')
+
+ AssertEqual {
+ \ bufnr(''): {
+ \ 'temporary_directory_list': [],
+ \ 'done': 0,
+ \ 'lines_before': ['a', 'b', 'c'],
+ \ 'should_save': 0,
+ \ 'ignore_file_changed_errors': 1,
\ },
\}, g:ale_fix_buffer_data