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.vader26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader
index a728fce0..6764dffe 100644
--- a/test/test_highlight_placement.vader
+++ b/test/test_highlight_placement.vader
@@ -31,6 +31,8 @@ Before:
highlight link SomeOtherGroup SpellBad
After:
+ unlet! g:items
+
delfunction GenerateResults
call ale#linter#Reset()
let g:ale_buffer_info = {}
@@ -173,3 +175,27 @@ Execute(Higlight end columns should set an appropriate size):
\ {'group': 'ALEInfo', 'id': 23, 'priority': 10, 'pos1': [7, 1, 1]},
\ ],
\ getmatches()
+
+Execute(Highlighting should support errors spanning many lines):
+ let g:items = [
+ \ {'bufnr': bufnr(''), 'type': 'E', 'lnum': 1, 'col': 1, 'end_lnum': 10, 'end_col': 3},
+ \]
+
+ call ale#highlight#SetHighlights(bufnr(''), g:items)
+
+ " We should set 2 highlights for the item, as we can only add 8 at a time.
+ AssertEqual
+ \ [
+ \ {
+ \ 'group': 'ALEError', 'id': 24, 'priority': 10, 'pos1': [1, 1, 1073741824],
+ \ 'pos2': [2], 'pos3': [3], 'pos4': [4], 'pos5': [5], 'pos6': [6],
+ \ 'pos7': [7], 'pos8': [8],
+ \ },
+ \ {
+ \ 'group': 'ALEError', 'id': 25, 'priority': 10,
+ \ 'pos1': [9], 'pos2': [10, 1, 3]
+ \ },
+ \ ],
+ \ getmatches()
+
+ AssertEqual [[24, 25]], map(copy(g:items), 'v:val.match_id_list')