summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_highlight_placement.vader16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader
index bca7bfda..14c16328 100644
--- a/test/test_highlight_placement.vader
+++ b/test/test_highlight_placement.vader
@@ -91,3 +91,19 @@ Execute(Highlights set by ALE should be removed when buffer cleanup is done):
call ale#cleanup#Buffer(bufnr('%'))
AssertEqual [], getmatches()
+
+Execute(Highlights should be cleared when buffers are hidden):
+ call ale#engine#InitBufferInfo(bufnr('%'))
+ call ale#highlight#SetHighlights(bufnr('%'), [
+ \ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
+ \])
+
+ AssertEqual 1, len(getmatches()), 'The highlights weren''t initially set!'
+
+ call ale#highlight#BufferHidden(bufnr('%'))
+
+ AssertEqual 0, len(getmatches()), 'The highlights weren''t cleared!'
+
+ call ale#highlight#UpdateHighlights()
+
+ AssertEqual 1, len(getmatches()), 'The highlights weren''t set again!'