summaryrefslogtreecommitdiff
path: root/test/test_highlight_placement.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-31 13:14:39 +0100
committerw0rp <devw0rp@gmail.com>2017-05-31 13:14:39 +0100
commitab50b3a88a741ac86315ae3e716815c6725b159b (patch)
tree7bfed55d7e6537db505495a996133ec2f654b090 /test/test_highlight_placement.vader
parent676a4049b35f7e4faa4ea55ee8a371a44cf1ab61 (diff)
downloadale-ab50b3a88a741ac86315ae3e716815c6725b159b.zip
Fix #604 - Support highlights spanning many lines
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')