summaryrefslogtreecommitdiff
path: root/test/test_ale_fix.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ale_fix.vader')
-rw-r--r--test/test_ale_fix.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader
index 5421dcfc..0974d10b 100644
--- a/test/test_ale_fix.vader
+++ b/test/test_ale_fix.vader
@@ -35,6 +35,10 @@ Before:
return {'command': 'cat - <(echo d)'}
endfunction
+ function CatLineOneArg(buffer) abort
+ return {'command': 'cat - <(echo d)'}
+ endfunction
+
function ReplaceWithTempFile(buffer, lines) abort
return {'command': 'echo x > %t', 'read_temporary_file': 1}
endfunction
@@ -43,6 +47,10 @@ Before:
return ['a', 'b']
endfunction
+ function RemoveLastLineOneArg(buffer) abort
+ return ['a', 'b']
+ endfunction
+
function! TestCallback(buffer, output)
return [{'lnum': 1, 'col': 1, 'text': 'xxx'}]
endfunction
@@ -65,8 +73,10 @@ After:
delfunction AddDollars
delfunction DoNothing
delfunction CatLine
+ delfunction CatLineOneArg
delfunction ReplaceWithTempFile
delfunction RemoveLastLine
+ delfunction RemoveLastLineOneArg
delfunction TestCallback
delfunction SetUpLinters
call ale#fix#registry#ResetToDefaults()
@@ -315,3 +325,21 @@ Execute(ale#fix#InitBufferData() should set up the correct data):
\ 'should_save': 1,
\ },
\}, g:ale_fix_buffer_data
+
+Execute(ALEFix simple functions should be able to accept one argument, the buffer):
+ let g:ale_fixers.testft = ['RemoveLastLineOneArg']
+ ALEFix
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(ALEFix functions returning jobs should be able to accept one argument):
+ let g:ale_fixers.testft = ['CatLine']
+ ALEFix
+
+Expect(An extra line should be added):
+ a
+ b
+ c
+ d