summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-02-26 16:56:16 +0000
committerw0rp <devw0rp@gmail.com>2019-02-26 16:56:16 +0000
commit38009b8e58133739ceb47d46bddb46620c33317f (patch)
tree3e9706b49314ddc121c5e6e42d0412d253e84e39
parent70a9176de0a4fd821fa60d5324ff0a3b5c086e5c (diff)
downloadale-38009b8e58133739ceb47d46bddb46620c33317f.zip
#2132 - Support deferred fixers
-rw-r--r--test/fix/test_ale_fix.vader18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader
index e5ecd46c..3d668599 100644
--- a/test/fix/test_ale_fix.vader
+++ b/test/fix/test_ale_fix.vader
@@ -56,6 +56,12 @@ Before:
return {'command': 'cat - <(echo d)'}
endfunction
+ function CatLineDeferred(buffer, lines) abort
+ return ale#command#Run(a:buffer, 'echo', {
+ \ -> ale#command#Run(a:buffer, 'echo', {-> {'command': 'cat - <(echo d)'}})
+ \})
+ endfunction
+
function ReplaceWithTempFile(buffer, lines) abort
return {'command': 'echo x > %t', 'read_temporary_file': 1}
endfunction
@@ -193,6 +199,7 @@ After:
delfunction DoNothing
delfunction CatLine
delfunction CatLineOneArg
+ delfunction CatLineDeferred
delfunction ReplaceWithTempFile
delfunction CatWithTempFile
delfunction RemoveLastLine
@@ -807,3 +814,14 @@ Execute(ALEFix should apply autocmds):
AssertEqual g:pre_success, 1
AssertEqual g:post_success, 1
+
+Execute(ALEFix should support ale#command#Run):
+ let g:ale_fixers.testft = ['CatLineDeferred']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The extra line should be added):
+ a
+ b
+ c
+ d