install.fairie/dotfiles/.vim/plugged/ale/test/test_balloon_messages.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

87 lines
2.2 KiB
Text

Before:
Save g:ale_buffer_info
Save g:ale_enabled
Save g:ale_set_balloons
let g:ale_set_balloons = 1
let g:ale_buffer_info[bufnr('')] = {'loclist': [
\ {
\ 'bufnr': bufnr('%'),
\ 'lnum': 1,
\ 'col': 10,
\ 'linter_name': 'eslint',
\ 'type': 'W',
\ 'text': 'Ignore me.',
\ },
\ {
\ 'bufnr': bufnr(''),
\ 'lnum': 1,
\ 'col': 10,
\ 'text': 'Missing semicolon. (semi)',
\ 'type': 'E',
\ },
\ {
\ 'bufnr': bufnr(''),
\ 'lnum': 2,
\ 'col': 10,
\ 'text': 'Infix operators must be spaced. (space-infix-ops)'
\ },
\ {
\ 'bufnr': bufnr(''),
\ 'lnum': 2,
\ 'col': 15,
\ 'text': 'Missing radix parameter (radix)'
\ },
\]}
After:
Restore
unlet! b:ale_enabled
unlet! b:ale_set_balloons
Execute(Balloon messages should be shown for the correct lines):
AssertEqual
\ 'Missing semicolon. (semi)',
\ ale#balloon#MessageForPos(bufnr(''), 1, 1)
Execute(Balloon messages should be shown for earlier columns):
AssertEqual
\ 'Infix operators must be spaced. (space-infix-ops)',
\ ale#balloon#MessageForPos(bufnr(''), 2, 1)
Execute(Balloon messages should be shown for later columns):
AssertEqual
\ 'Missing radix parameter (radix)',
\ ale#balloon#MessageForPos(bufnr(''), 2, 16)
Execute(Balloon messages should be disabled if ALE is disabled globally):
let g:ale_enabled = 0
" Enabling the buffer should not make a difference.
let b:ale_enabled = 1
AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
Execute(Balloon messages should be disabled if ALE is disabled for a buffer):
let b:ale_enabled = 0
AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
Execute(Balloon messages should be disabled if the global setting is off):
let g:ale_set_balloons = 0
AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
Execute(Balloon messages should be disabled if the buffer setting is off):
let b:ale_set_balloons = 0
AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
Execute(The balloon buffer setting should override the global one):
let g:ale_set_balloons = 0
let b:ale_set_balloons = 1
AssertEqual
\ 'Missing semicolon. (semi)',
\ ale#balloon#MessageForPos(bufnr(''), 1, 1)