summaryrefslogtreecommitdiff
path: root/test/test_cursor_warnings.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-12 23:19:26 +0000
committerw0rp <devw0rp@gmail.com>2017-11-12 23:19:26 +0000
commit70623ca8a7ffadac0d282b4737dbb7322659c592 (patch)
treedb71facbb77c0bbb67ae2b73033b62f67d0acec5 /test/test_cursor_warnings.vader
parent7d056b0839a6d716533bce73cd72555aec6f5837 (diff)
downloadale-70623ca8a7ffadac0d282b4737dbb7322659c592.zip
Add support for showing Info severities in echoed messages
Diffstat (limited to 'test/test_cursor_warnings.vader')
-rw-r--r--test/test_cursor_warnings.vader46
1 files changed, 45 insertions, 1 deletions
diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader
index 586cc13c..20ccb157 100644
--- a/test/test_cursor_warnings.vader
+++ b/test/test_cursor_warnings.vader
@@ -1,4 +1,6 @@
Before:
+ Save g:ale_echo_msg_format
+
let g:ale_buffer_info = {
\ bufnr('%'): {
\ 'loclist': [
@@ -14,6 +16,16 @@ Before:
\ 'detail': "Every statement should end with a semicolon\nsecond line"
\ },
\ {
+ \ 'lnum': 1,
+ \ 'col': 14,
+ \ 'bufnr': bufnr('%'),
+ \ 'vcol': 0,
+ \ 'linter_name': 'eslint',
+ \ 'nr': -1,
+ \ 'type': 'I',
+ \ 'text': 'Some information',
+ \ },
+ \ {
\ 'lnum': 2,
\ 'col': 10,
\ 'bufnr': bufnr('%'),
@@ -63,6 +75,8 @@ Before:
endfunction
After:
+ Restore
+
call cursor(1, 1)
let g:ale_set_loclist = 1
@@ -81,7 +95,7 @@ After:
echomsg ''
Given javascript(A Javscript file with warnings/errors):
- var x = 3
+ var x = 3 + 12345678
var x = 5*2 + parseInt("10");
// comment
@@ -141,3 +155,33 @@ Execute(ALEDetail should not capitlise cursor messages):
call ale#cursor#EchoCursorWarning()
AssertEqual 'lowercase error', GetLastMessage()
+
+Execute(The linter name should be formatted into the message correctly):
+ let g:ale_echo_msg_format = '%linter%: %s'
+
+ call cursor(2, 9)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual
+ \ 'eslint: Infix operators must be spaced. (space-infix-ops)',
+ \ GetLastMessage()
+
+Execute(The severity should be formatted into the message correctly):
+ let g:ale_echo_msg_format = '%severity%: %s'
+
+ call cursor(2, 9)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual
+ \ 'Warning: Infix operators must be spaced. (space-infix-ops)',
+ \ GetLastMessage()
+
+ call cursor(1, 10)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual 'Error: Missing semicolon. (semi)', GetLastMessage()
+
+ call cursor(1, 14)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual 'Info: Some information', GetLastMessage()