diff options
author | w0rp <devw0rp@gmail.com> | 2017-06-28 16:20:01 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-06-28 16:20:05 +0100 |
commit | 8846a8860f39027c0c2a7aba9e49ad2fdacd5428 (patch) | |
tree | 85340d62b2fdb0d68e4d76694f47bd00165ba3c1 /test/test_ale_fix_suggest.vader | |
parent | f883d4d4fd20a928f2d224f342d5751ff3fd1a18 (diff) | |
download | ale-8846a8860f39027c0c2a7aba9e49ad2fdacd5428.zip |
Use a new window for the ALEFixSuggest command, and document it better
Diffstat (limited to 'test/test_ale_fix_suggest.vader')
-rw-r--r-- | test/test_ale_fix_suggest.vader | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/test/test_ale_fix_suggest.vader b/test/test_ale_fix_suggest.vader index 9a7aecbf..97227b4f 100644 --- a/test/test_ale_fix_suggest.vader +++ b/test/test_ale_fix_suggest.vader @@ -1,15 +1,27 @@ Before: call ale#fix#registry#Clear() + let g:buffer = bufnr('') + function GetSuggestions() - redir => l:output - silent ALEFixSuggest - redir END + silent ALEFixSuggest + + if bufnr('') != g:buffer + let l:lines = getline(1, '$') + else + let l:lines = [] + endif - return split(l:output, "\n") + return l:lines endfunction After: + if bufnr('') != g:buffer + :q! + endif + + unlet! g:buffer + call ale#fix#registry#ResetToDefaults() delfunction GetSuggestions @@ -17,9 +29,18 @@ Execute(ALEFixSuggest should return something sensible with no suggestions): AssertEqual \ [ \ 'There is nothing in the registry to suggest.', + \ '', + \ 'Press q to close this window', \ ], \ GetSuggestions() +Execute(ALEFixSuggest should set the appropriate settings): + silent ALEFixSuggest + + AssertEqual 'ale-fix-suggest', &filetype + Assert !&modified, 'The buffer was marked as modified' + Assert !&modifiable, 'The buffer was modifiable' + Execute(ALEFixSuggest output should be correct for only generic handlers): call ale#fix#registry#Add('zed', 'XYZ', [], 'Zedify things.') call ale#fix#registry#Add('alpha', 'XYZ', [], 'Alpha things.') @@ -32,6 +53,8 @@ Execute(ALEFixSuggest output should be correct for only generic handlers): \ '''zed'' - Zedify things.', \ '', \ 'See :help ale-fix-configuration', + \ '', + \ 'Press q to close this window', \ ], \ GetSuggestions() @@ -49,6 +72,8 @@ Execute(ALEFixSuggest output should be correct for only filetype handlers): \ '''zed'' - Zedify things.', \ '', \ 'See :help ale-fix-configuration', + \ '', + \ 'Press q to close this window', \ ], \ GetSuggestions() @@ -71,5 +96,7 @@ Execute(ALEFixSuggest should suggest filetype and generic handlers): \ '''generic'' - Generic things.', \ '', \ 'See :help ale-fix-configuration', + \ '', + \ 'Press q to close this window', \ ], \ GetSuggestions() |