From 6853d2c304e5eae22393208f91b0d072d2f22d74 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 27 Apr 2017 00:07:41 +0100 Subject: #427 - Output buffer-local variables with :ALEInfo --- test/test_ale_info.vader | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'test') 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): @@ -59,6 +61,26 @@ Execute (ALEInfo with no linters should return the right output): \ Linter Variables:\n \" . 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 @@ -166,6 +188,26 @@ Execute (ALEInfo should return appropriately named global variables): \let g:ale_testft_testlinter1_foo = 'abc'" \ . 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('%')] = { -- cgit v1.2.3