diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/command_callback/test_pylint_command_callback.vader | 13 | ||||
-rw-r--r-- | test/fix/test_ale_fix.vader | 9 | ||||
-rw-r--r-- | test/fix/test_ale_fix_completion.vader | 23 |
3 files changed, 45 insertions, 0 deletions
diff --git a/test/command_callback/test_pylint_command_callback.vader b/test/command_callback/test_pylint_command_callback.vader index 5dc6abe9..1cdc34d4 100644 --- a/test/command_callback/test_pylint_command_callback.vader +++ b/test/command_callback/test_pylint_command_callback.vader @@ -2,10 +2,12 @@ Before: Save g:ale_python_pylint_executable Save g:ale_python_pylint_options Save g:ale_python_pylint_use_global + Save g:ale_python_pylint_change_directory unlet! g:ale_python_pylint_executable unlet! g:ale_python_pylint_options unlet! g:ale_python_pylint_use_global + unlet! g:ale_python_pylint_change_directory runtime ale_linters/python/pylint.vim call ale#test#SetDirectory('/testplugin/test/command_callback') @@ -32,6 +34,17 @@ Execute(The pylint callbacks should return the correct default values): \ . ale#Escape('pylint') . ' ' . b:command_tail, \ ale_linters#python#pylint#GetCommand(bufnr('')) +Execute(The option for disabling changing directories should work): + let g:ale_python_pylint_change_directory = 0 + + AssertEqual + \ 'pylint', + \ ale_linters#python#pylint#GetExecutable(bufnr('')) + \ + AssertEqual + \ ale#Escape('pylint') . ' ' . b:command_tail, + \ ale_linters#python#pylint#GetCommand(bufnr('')) + Execute(The pylint executable should be configurable, and escaped properly): let g:ale_python_pylint_executable = 'executable with spaces' diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader index 0321cbae..3bd23672 100644 --- a/test/fix/test_ale_fix.vader +++ b/test/fix/test_ale_fix.vader @@ -272,6 +272,15 @@ Expect(An extra line should be added): c d +Execute(ALEFix should use fixers passed in commandline when provided): + let g:ale_fixers.testft = ['RemoveLastLine'] + ALEFix AddCarets AddDollars + +Expect(Only fixers passed via command line should be run): + $^a + $^b + $^c + Execute(ALEFix should allow temporary files to be read): if has('win32') " Just skip this test on Windows, we can't run it. diff --git a/test/fix/test_ale_fix_completion.vader b/test/fix/test_ale_fix_completion.vader new file mode 100644 index 00000000..6c38bb8d --- /dev/null +++ b/test/fix/test_ale_fix_completion.vader @@ -0,0 +1,23 @@ +Execute (List of available fixers is empty): + call ale#fix#registry#Clear() + +Then (List of applicable fixers for python file is empty): + AssertEqual [], ale#fix#registry#GetApplicableFixers('python') + +Execute (Add ruby fixer): + call ale#fix#registry#Add('ruby_fixer', 'fixer_fun', ['ruby'], 'ruby fixer') + +Then (List of applicable fixers for python file is still empty): + AssertEqual [], ale#fix#registry#GetApplicableFixers('python') + +Execute (Add generic fixer): + call ale#fix#registry#Add('generic_fixer', 'fixer_fun', [], 'generic fixer') + +Then (Generic fixer should be returned as applicable for python file): + AssertEqual ['generic_fixer'], ale#fix#registry#GetApplicableFixers('python') + +Execute (Add python fixer): + call ale#fix#registry#Add('python_fixer', 'fixer_func', ['python'], 'python fixer') + +Then (List of fixers should contain both generic and python fixers): + AssertEqual ['generic_fixer', 'python_fixer'], ale#fix#registry#GetApplicableFixers('python') |