summaryrefslogtreecommitdiff
path: root/test/test_highlight_placement.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_highlight_placement.vader')
-rw-r--r--test/test_highlight_placement.vader17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader
index 52e861d9..bca7bfda 100644
--- a/test/test_highlight_placement.vader
+++ b/test/test_highlight_placement.vader
@@ -74,3 +74,20 @@ Execute(Existing highlights should be kept):
\ {'group': 'ALEWarning', 'id': 8, 'priority': 10, 'pos1': [4, 1, 1]},
\ ],
\ getmatches()
+
+" This test is important for preventing ALE from showing highlights for
+" the wrong files.
+Execute(Highlights set by ALE should be removed when buffer cleanup is done):
+ call ale#engine#InitBufferInfo(bufnr('%'))
+
+ call ale#highlight#SetHighlights(bufnr('%'), [
+ \ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
+ \])
+
+ AssertEqual
+ \ [{'group': 'ALEError', 'id': 9, 'priority': 10, 'pos1': [3, 2, 1]}],
+ \ getmatches()
+
+ call ale#cleanup#Buffer(bufnr('%'))
+
+ AssertEqual [], getmatches()