Fix the cursor tests, that stop tests running

This commit is contained in:
w0rp 2020-04-18 12:26:38 +01:00
parent 93a13d7353
commit 1f9ac1c6dc
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83

View File

@ -15,7 +15,7 @@ Before:
\ 'col': 10, \ 'col': 10,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'W', \ 'type': 'W',
\ 'code': 'semi', \ 'code': 'semi',
@ -26,7 +26,7 @@ Before:
\ 'col': 10, \ 'col': 10,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'E', \ 'type': 'E',
\ 'code': 'semi', \ 'code': 'semi',
@ -38,7 +38,7 @@ Before:
\ 'col': 14, \ 'col': 14,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'I', \ 'type': 'I',
\ 'text': 'Some information', \ 'text': 'Some information',
@ -48,7 +48,7 @@ Before:
\ 'col': 10, \ 'col': 10,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'W', \ 'type': 'W',
\ 'code': 'space-infix-ops', \ 'code': 'space-infix-ops',
@ -59,7 +59,7 @@ Before:
\ 'col': 15, \ 'col': 15,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'E', \ 'type': 'E',
\ 'code': 'radix', \ 'code': 'radix',
@ -70,22 +70,11 @@ Before:
\ 'col': 1, \ 'col': 1,
\ 'bufnr': bufnr('%'), \ 'bufnr': bufnr('%'),
\ 'vcol': 0, \ 'vcol': 0,
\ 'linter_name': 'eslint', \ 'linter_name': 'bettercode',
\ 'nr': -1, \ 'nr': -1,
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'lowercase error', \ 'text': 'lowercase error',
\ }, \ },
\ {
\ 'lnum': 3,
\ 'col': 5,
\ 'bufnr': bufnr('%'),
\ 'vcol': 0,
\ 'linter_name': 'fakecodelinter',
\ 'nr': -1,
\ 'type': 'E',
\ 'code': 'E001',
\ 'text': 'This error does not exist',
\ },
\ ], \ ],
\ }, \ },
\} \}
@ -207,7 +196,7 @@ Execute(The linter name should be formatted into the message correctly):
call ale#cursor#EchoCursorWarning() call ale#cursor#EchoCursorWarning()
AssertEqual AssertEqual
\ 'eslint: Infix operators must be spaced.', \ 'bettercode: Infix operators must be spaced.',
\ GetLastMessage() \ GetLastMessage()
Execute(The severity should be formatted into the message correctly): Execute(The severity should be formatted into the message correctly):
@ -248,14 +237,6 @@ Execute(The %code% and %ifcode% should be removed when there's no code):
AssertEqual 'Some information', GetLastMessage() AssertEqual 'Some information', GetLastMessage()
Execute(The %code% should be formatted correctly when other variables contain 'code'):
let g:ale_echo_msg_format = '%s (%linter%% code%)'
call cursor(3, 5)
call ale#cursor#EchoCursorWarning()
AssertEqual 'This error does not exist (fakecodelinter E001)', GetLastMessage()
Execute(The buffer message format option should take precedence): Execute(The buffer message format option should take precedence):
let g:ale_echo_msg_format = '%(code) %%s' let g:ale_echo_msg_format = '%(code) %%s'
let b:ale_echo_msg_format = 'FOO %s' let b:ale_echo_msg_format = 'FOO %s'