summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_cursor_warnings.vader10
-rw-r--r--test/test_list_formatting.vader24
2 files changed, 34 insertions, 0 deletions
diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader
index c6dc5269..f112d8dc 100644
--- a/test/test_cursor_warnings.vader
+++ b/test/test_cursor_warnings.vader
@@ -89,6 +89,7 @@ After:
let g:ale_buffer_info = {}
unlet! g:output
+ unlet! b:ale_loclist_msg_format
delfunction GetLastMessage
@@ -212,3 +213,12 @@ Execute(The %code% and %ifcode% should be removed when there's no code):
call ale#cursor#EchoCursorWarning()
AssertEqual 'Some information', GetLastMessage()
+
+Execute(The buffer message format option should take precedence):
+ let g:ale_echo_msg_format = '%(code) %%s'
+ let b:ale_echo_msg_format = 'FOO %s'
+
+ call cursor(1, 14)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual 'FOO Some information', GetLastMessage()
diff --git a/test/test_list_formatting.vader b/test/test_list_formatting.vader
index 6b494fc2..0c52f10f 100644
--- a/test/test_list_formatting.vader
+++ b/test/test_list_formatting.vader
@@ -28,6 +28,7 @@ After:
Restore
unlet! g:loclist
+ unlet! b:ale_loclist_msg_format
delfunction AddItem
@@ -162,3 +163,26 @@ Execute(Formatting with the linter name should work for the quickfix list):
\ },
\ ],
\ getqflist()
+
+Execute(The buffer loclist format option should take precedence):
+ let g:ale_loclist_msg_format = '(%linter%) %s'
+ let b:ale_loclist_msg_format = 'FOO %s'
+
+ call AddItem({'text': 'whatever'})
+ call ale#list#SetLists(bufnr(''), g:loclist)
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'bufnr': bufnr(''),
+ \ 'col': 1,
+ \ 'valid': 1,
+ \ 'vcol': 0,
+ \ 'nr': 0,
+ \ 'type': 'E',
+ \ 'pattern': '',
+ \ 'text': 'FOO whatever',
+ \ },
+ \ ],
+ \ getloclist(0)