diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ale_info.vader | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader index d5a8ed62..83d32cb0 100644 --- a/test/test_ale_info.vader +++ b/test/test_ale_info.vader @@ -37,6 +37,7 @@ Before: let g:command_header = "\n Command History:\n" After: + unlet! b:ale_linters unlet! g:output unlet! g:globals_string unlet! g:command_header @@ -45,6 +46,7 @@ After: unlet! g:ale_testft_testlinter1_foo unlet! g:ale_testft_testlinter1_bar unlet! g:ale_testft2_testlinter2_foo + unlet! b:ale_testft2_testlinter2_foo unlet! g:ale_testft2_testlinter2_bar Given nolintersft (Empty buffer with no linters): @@ -60,6 +62,26 @@ Execute (ALEInfo with no linters should return the right output): \" . g:globals_string . g:command_header, g:output Given (Empty buffer with no filetype): +Execute (ALEInfo should return buffer-local global ALE settings): + let b:ale_linters = {'x': ['y']} + let g:globals_string = substitute( + \ g:globals_string, + \ 'let g:ale_linters = {}', + \ "let g:ale_linters = {}\nlet b:ale_linters = {'x': ['y']}", + \ '' + \) + + redir => g:output + silent ALEInfo + redir END + AssertEqual "\n + \ Current Filetype: \n + \Available Linters: []\n + \ Enabled Linters: []\n + \ Linter Variables:\n + \" . g:globals_string . g:command_header, g:output + +Given (Empty buffer with no filetype): Execute (ALEInfo with no filetype should return the right output): redir => g:output silent ALEInfo @@ -167,6 +189,26 @@ Execute (ALEInfo should return appropriately named global variables): \ . g:globals_string . g:command_header, g:output Given testft.testft2 (Empty buffer with two filetypes): +Execute (ALEInfo should buffer-local linter variables): + let g:ale_testft2_testlinter2_foo = 123 + let b:ale_testft2_testlinter2_foo = 456 + + call ale#linter#Define('testft', g:testlinter1) + call ale#linter#Define('testft2', g:testlinter2) + redir => g:output + silent ALEInfo + redir END + AssertEqual "\n + \ Current Filetype: testft.testft2\n + \Available Linters: ['testlinter1', 'testlinter2']\n + \ Enabled Linters: ['testlinter1', 'testlinter2']\n + \ Linter Variables:\n + \\n + \let g:ale_testft2_testlinter2_foo = 123\n + \let b:ale_testft2_testlinter2_foo = 456" + \ . g:globals_string . g:command_header, g:output + +Given testft.testft2 (Empty buffer with two filetypes): Execute (ALEInfo should return command history): let g:ale_buffer_info[bufnr('%')] = { \ 'history': [ |