diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-13 23:27:02 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-13 23:27:02 +0100 |
commit | 4c6c5bf84fa31ab18ff83122c12b7e8edb18bd1e (patch) | |
tree | 6150657f24ba48b20486ce6d97b62b8a0ea7134e /test | |
parent | b50ae96413ef34c1ab631507d6763e7667fe8c85 (diff) | |
download | ale-4c6c5bf84fa31ab18ff83122c12b7e8edb18bd1e.zip |
#697 - Remove highlights more thoroughly
Diffstat (limited to 'test')
-rw-r--r-- | test/test_highlight_clearing.vader | 4 | ||||
-rw-r--r-- | test/test_highlight_placement.vader | 26 |
2 files changed, 26 insertions, 4 deletions
diff --git a/test/test_highlight_clearing.vader b/test/test_highlight_clearing.vader deleted file mode 100644 index bf805924..00000000 --- a/test/test_highlight_clearing.vader +++ /dev/null @@ -1,4 +0,0 @@ -Execute(ALE should be able to queue highlights and clear them for some other buffer): - " We'll just make sure that this doesn't blow up. - call ale#highlight#SetHighlights(bufnr('%') + 1, []) - call ale#highlight#UnqueueHighlights(bufnr('%') + 1) diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader index 2e6a0ce3..02f570b9 100644 --- a/test/test_highlight_placement.vader +++ b/test/test_highlight_placement.vader @@ -204,3 +204,29 @@ Execute(Highlighting should support errors spanning many lines): \ }, \ ], \ GetMatchesWithoutIDs() + \ +Execute(Highlights should always be cleared when the buffer highlight list is empty): + " Add our highlights and something else. + call matchaddpos('ALEError', [[1, 1, 1]]) + call matchaddpos('SomeOtherGroup', [[1, 1, 1]]) + + AssertEqual + \ [ + \ {'group': 'ALEError', 'priority': 10, 'pos1': [1, 1, 1]}, + \ {'group': 'SomeOtherGroup', 'priority': 10, 'pos1': [1, 1, 1]}, + \ ], + \ GetMatchesWithoutIDs() + + " Set the List we use for holding highlights for buffers. + let b:ale_highlight_items = [] + + " Call the function for updating the highlights called when buffers + " are entered, or when problems are presented. + call ale#highlight#UpdateHighlights() + + " Check that we remove our highlights. + AssertEqual + \ [ + \ {'group': 'SomeOtherGroup', 'priority': 10, 'pos1': [1, 1, 1]}, + \ ], + \ GetMatchesWithoutIDs() |