diff options
author | w0rp <devw0rp@gmail.com> | 2018-04-08 19:04:07 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-04-08 19:04:07 +0100 |
commit | 7cf3ddf6c4354db406a19104f352565d42a827d2 (patch) | |
tree | e9cf7c8d3fffaf2f12abe0d86305744591fbd717 /test | |
parent | 1123669839c1656deb20f433fc672ca0abdda705 (diff) | |
download | ale-7cf3ddf6c4354db406a19104f352565d42a827d2.zip |
Close #1439 - Add an :ALEInfoToFile command
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ale_info.vader | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader index 05c045bb..8914507a 100644 --- a/test/test_ale_info.vader +++ b/test/test_ale_info.vader @@ -105,6 +105,8 @@ Before: AssertEqual a:expected_list, split(l:output, "\n") endfunction + call ale#test#SetDirectory('/testplugin/test') + After: Restore @@ -123,6 +125,8 @@ After: unlet! g:ale_testft2_testlinter2_bar delfunction CheckInfo + call ale#test#RestoreDirectory() + Given nolintersft (Empty buffer with no linters): Execute (ALEInfo with no linters should return the right output): call CheckInfo([ @@ -251,6 +255,33 @@ Execute (ALEInfo should return appropriately named global variables): \ 'let g:ale_testft_testlinter1_foo = ''abc''', \] + g:globals_lines + g:command_header) +Execute (ALEInfoToFile should write to a file correctly): + if filereadable(g:dir . '/ale-info-test-file') + call delete(g:dir . '/ale-info-test-file') + endif + + let g:ale_testft_testlinter1_foo = 'abc' + let g:ale_testft_testlinter1_bar = ['abc'] + let g:ale_testft2_testlinter2_foo = 123 + let g:ale_testft2_testlinter2_bar = {'x': 'y'} + + call ale#linter#Define('testft', g:testlinter1) + call ale#linter#Define('testft2', g:testlinter2) + + execute 'ALEInfoToFile ' . fnameescape(g:dir . '/ale-info-test-file') + + AssertEqual [ + \ ' Current Filetype: testft.testft2', + \ 'Available Linters: [''testlinter1'', ''testlinter2'']', + \ ' Enabled Linters: [''testlinter1'', ''testlinter2'']', + \ ' Linter Variables:', + \ '', + \ 'let g:ale_testft2_testlinter2_bar = {''x'': ''y''}', + \ 'let g:ale_testft2_testlinter2_foo = 123', + \ 'let g:ale_testft_testlinter1_bar = [''abc'']', + \ 'let g:ale_testft_testlinter1_foo = ''abc''', + \] + g:globals_lines + g:command_header, readfile(g:dir . '/ale-info-test-file') + Given testft.testft2 (Empty buffer with two filetypes): Execute (ALEInfo should buffer-local linter variables): let g:ale_testft2_testlinter2_foo = 123 |