diff options
author | cos <cos> | 2022-02-02 15:03:36 +0100 |
---|---|---|
committer | cos <cos> | 2022-02-08 12:11:06 +0100 |
commit | 56f473731c8a45221172a4c3128d3654345eac9e (patch) | |
tree | 5083ba4f43633706a75880214ea32b7657876f01 /test | |
parent | 5856c067755d5ff9e14c306d93d1a3605ee966fc (diff) | |
download | ale-feature/open_list_num.zip |
Treat ale_open_list integer values as thresholdsfeature/open_list_num
Only open list window if the number of warnings or errors equals to or
exceeds the value of ale_open_list. No change when set to `1`.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_list_opening.vader | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_list_opening.vader b/test/test_list_opening.vader index 8f0b2fd5..44004182 100644 --- a/test/test_list_opening.vader +++ b/test/test_list_opening.vader @@ -97,6 +97,34 @@ Execute(The quickfix window should open for just the loclist): call ale#list#SetLists(bufnr('%'), []) Assert !ale#list#IsQuickfixOpen() +Execute(The quickfix window should open on the correct threshold): + " The window should open for a value lower than number of entries. + let g:ale_open_list = len(g:loclist) - 1 + call ale#list#SetLists(bufnr('%'), g:loclist) + Assert ale#list#IsQuickfixOpen() + + " Clear the list to be ready for a new value. + call ale#list#SetLists(bufnr('%'), []) + Assert !ale#list#IsQuickfixOpen() + + " It should also open for a value equal to the number of entries. + let g:ale_open_list = len(g:loclist) + call ale#list#SetLists(bufnr('%'), g:loclist) + Assert ale#list#IsQuickfixOpen() + + " Clear the list again, preparing for a final value. + call ale#list#SetLists(bufnr('%'), []) + Assert !ale#list#IsQuickfixOpen() + + " Window should not open for values higher than number of loclist entries. + let g:ale_open_list = len(g:loclist) + 1 + call ale#list#SetLists(bufnr('%'), g:loclist) + Assert !ale#list#IsQuickfixOpen() + + " Clear the list just to clean up. + call ale#list#SetLists(bufnr('%'), []) + Assert !ale#list#IsQuickfixOpen() + Execute(The quickfix window height should be correct for the loclist): let g:ale_open_list = 1 let g:ale_list_window_size = 7 |