diff options
author | w0rp <devw0rp@gmail.com> | 2018-12-18 11:13:28 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-12-18 11:13:28 +0000 |
commit | f1ed654ca5318de5a24b37d882e55e04e4e566c8 (patch) | |
tree | 2a41c15887e1bf5a9fed3b466a2c24f62545d54a /test | |
parent | 0e3778e335f67a48571bf2b7c5c59c73005efdfa (diff) | |
download | ale-f1ed654ca5318de5a24b37d882e55e04e4e566c8.zip |
#2132 Change (buffer, lines) fixer functions to (buffer, done, lines)
Diffstat (limited to 'test')
-rw-r--r-- | test/fix/test_ale_fix.vader | 18 | ||||
-rw-r--r-- | test/fixers/test_break_up_long_lines_python_fixer.vader | 4 | ||||
-rw-r--r-- | test/fixers/test_trim_whitespace.vader | 18 | ||||
-rw-r--r-- | test/test_no_linting_on_write_quit.vader | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader index 90407681..1b1891ce 100644 --- a/test/fix/test_ale_fix.vader +++ b/test/fix/test_ale_fix.vader @@ -33,21 +33,21 @@ Before: call ale#test#SetFilename('test.txt') call ale#linter#PreventLoading('testft') - function AddCarets(buffer, lines) abort + function AddCarets(buffer, done, lines) abort " map() is applied to the original lines here. " This way, we can ensure that defensive copies are made. return map(a:lines, '''^'' . v:val') endfunction - function AddDollars(buffer, lines) abort + function AddDollars(buffer, done, lines) abort return map(a:lines, '''$'' . v:val') endfunction - function DoNothing(buffer, lines) abort + function DoNothing(buffer, done, lines) abort return 0 endfunction - function CatLine(buffer, lines) abort + function CatLine(buffer, done, lines) abort return {'command': 'cat - <(echo d)'} endfunction @@ -55,11 +55,11 @@ Before: return {'command': 'cat - <(echo d)'} endfunction - function ReplaceWithTempFile(buffer, lines) abort + function ReplaceWithTempFile(buffer, done, lines) abort return {'command': 'echo x > %t', 'read_temporary_file': 1} endfunction - function RemoveLastLine(buffer, lines) abort + function RemoveLastLine(buffer, done, lines) abort return ['a', 'b'] endfunction @@ -122,11 +122,11 @@ Before: endfunction " echo will output a single blank line, and we should ingore it. - function! IgnoredEmptyOutput(buffer, output) + function! IgnoredEmptyOutput(buffer, done, output) return {'command': has('win32') ? 'echo(' : 'echo'} endfunction - function! EchoLineNoPipe(buffer, output) + function! EchoLineNoPipe(buffer, done, output) return {'command': 'echo new line', 'read_buffer': 0} endfunction @@ -399,7 +399,7 @@ Execute(ALEFix should accept lambdas): " to make the test pass. call setline(1, ['a', 'b', 'c', 'd']) else - let g:ale_fixers.testft = [{buffer, lines -> lines + ['d']}] + let g:ale_fixers.testft = [{buffer, done, lines -> lines + ['d']}] ALEFix endif diff --git a/test/fixers/test_break_up_long_lines_python_fixer.vader b/test/fixers/test_break_up_long_lines_python_fixer.vader index 5fd991f0..847d3358 100644 --- a/test/fixers/test_break_up_long_lines_python_fixer.vader +++ b/test/fixers/test_break_up_long_lines_python_fixer.vader @@ -16,7 +16,7 @@ Execute(Long lines with basic function calls should be broken up correctly): \ ' bar,', \ '))', \ ], - \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [ + \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), v:null, [ \ 'def foo():', \ ' some_variable = this_is_a_longer_function(first_argument, second_argument, third_with_function_call(foo, bar))', \ ]) @@ -33,7 +33,7 @@ Execute(Longer lines should be permitted if a configuration file allows it): \ ' a_third_long_word,', \ ')' \ ], - \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [ + \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), v:null, [ \ 'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)', \ 'y = this_line_is_longer_than_90_characters(much_longer_word, another_longer_word, a_third_long_word)', \ ]) diff --git a/test/fixers/test_trim_whitespace.vader b/test/fixers/test_trim_whitespace.vader index 2ffbcb04..10070374 100644 --- a/test/fixers/test_trim_whitespace.vader +++ b/test/fixers/test_trim_whitespace.vader @@ -16,13 +16,13 @@ Execute(Should delete all whitespace at the end of different lines): \ ' bar,', \ '))', \ ], - \ ale#fixers#generic#TrimWhitespace(bufnr(''), [ - \ 'def foo():', - \ ' some_variable = this_is_a_longer_function(', - \ 'first_argument,', - \ ' second_argument,', - \ ' third_with_function_call(', - \ 'foo,', - \ ' bar,', - \ '))', + \ ale#fixers#generic#TrimWhitespace(bufnr(''), v:null, [ + \ 'def foo():', + \ ' some_variable = this_is_a_longer_function(', + \ 'first_argument,', + \ ' second_argument,', + \ ' third_with_function_call(', + \ 'foo,', + \ ' bar,', + \ '))', \ ]) diff --git a/test/test_no_linting_on_write_quit.vader b/test/test_no_linting_on_write_quit.vader index 12ef38ed..75de06a4 100644 --- a/test/test_no_linting_on_write_quit.vader +++ b/test/test_no_linting_on_write_quit.vader @@ -23,7 +23,7 @@ Before: return [{'lnum': 1, 'col': 1, 'text': 'xxx'}] endfunction - function AddLine(buffer, lines) abort + function AddLine(buffer, done, lines) abort return a:lines + ['x'] endfunction |