summaryrefslogtreecommitdiff
path: root/test/sign/test_sign_column_highlighting.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-22 09:34:25 +0100
committerw0rp <devw0rp@gmail.com>2017-05-22 09:34:25 +0100
commit71bf2bfb94f19b99468b0115e3ea4efb5c241456 (patch)
treef7723ce87858567377aad6e4ccc94b87ceed1403 /test/sign/test_sign_column_highlighting.vader
parentc8ce15d9f180db4ae748539ea1cb9a840cbd360c (diff)
downloadale-71bf2bfb94f19b99468b0115e3ea4efb5c241456.zip
Fix #572 - Link to whatever SignColumn links to for ALESignColumnWithoutErrors
Diffstat (limited to 'test/sign/test_sign_column_highlighting.vader')
-rw-r--r--test/sign/test_sign_column_highlighting.vader34
1 files changed, 27 insertions, 7 deletions
diff --git a/test/sign/test_sign_column_highlighting.vader b/test/sign/test_sign_column_highlighting.vader
index da8bac29..81f80c90 100644
--- a/test/sign/test_sign_column_highlighting.vader
+++ b/test/sign/test_sign_column_highlighting.vader
@@ -1,22 +1,42 @@
Before:
- function! ParseSignColumnHighlight() abort
+ function! ParseHighlight(name) abort
redir => l:output
- silent highlight SignColumn
+ silent execute 'highlight ' . a:name
redir end
return join(split(l:output)[2:])
endfunction
- let g:sign_highlight = ParseSignColumnHighlight()
+ function! SetHighlight(name, syntax) abort
+ let l:match = matchlist(a:syntax, '\vlinks to (.+)$')
+
+ if !empty(l:match)
+ execute 'highlight link ' . a:name . ' ' . l:match[1]
+ else
+ execute 'highlight ' . a:name . ' ' a:syntax
+ endif
+ endfunction
+
+ let g:sign_highlight = ParseHighlight('SignColumn')
After:
- delfunction ParseSignColumnHighlight
- execute 'highlight SignColumn ' . g:sign_highlight
+ delfunction ParseHighlight
+ call SetHighlight('SignColumn', g:sign_highlight)
+ delfunction SetHighlight
unlet! g:sign_highlight
Execute(The SignColumn highlight should be set and reset):
call ale#sign#SetSignColumnHighlight(1)
- AssertEqual 'links to ALESignColumnWithErrors', ParseSignColumnHighlight()
+ AssertEqual 'links to ALESignColumnWithErrors', ParseHighlight('SignColumn')
call ale#sign#SetSignColumnHighlight(0)
- AssertEqual 'links to ALESignColumnWithoutErrors', ParseSignColumnHighlight()
+ AssertEqual 'links to ALESignColumnWithoutErrors', ParseHighlight('SignColumn')
+
+Execute(ALESignColumnWithoutErrors should link to what SignColumn links to):
+ highlight clear SignColumn
+ highlight link SignColumn LineNr
+ highlight clear ALESignColumnWithoutErrors
+
+ runtime 'autoload/ale/sign.vim'
+
+ AssertEqual 'links to LineNr', ParseHighlight('ALESignColumnWithoutErrors')