]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_balloon_messages.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / test_balloon_messages.vader
1 Before:
2   Save g:ale_buffer_info
3   Save g:ale_enabled
4   Save g:ale_set_balloons
5
6   let g:ale_set_balloons = 1
7
8   let g:ale_buffer_info[bufnr('')] = {'loclist': [
9   \ {
10   \   'bufnr': bufnr('%'),
11   \   'lnum': 1,
12   \   'col': 10,
13   \   'linter_name': 'eslint',
14   \   'type': 'W',
15   \   'text': 'Ignore me.',
16   \ },
17   \ {
18   \   'bufnr': bufnr(''),
19   \   'lnum': 1,
20   \   'col': 10,
21   \   'text': 'Missing semicolon. (semi)',
22   \   'type': 'E',
23   \ },
24   \ {
25   \   'bufnr': bufnr(''),
26   \   'lnum': 2,
27   \   'col': 10,
28   \   'text': 'Infix operators must be spaced. (space-infix-ops)'
29   \ },
30   \ {
31   \   'bufnr': bufnr(''),
32   \   'lnum': 2,
33   \   'col': 15,
34   \   'text': 'Missing radix parameter (radix)'
35   \ },
36   \]}
37
38 After:
39   Restore
40
41   unlet! b:ale_enabled
42   unlet! b:ale_set_balloons
43
44 Execute(Balloon messages should be shown for the correct lines):
45   AssertEqual
46   \ 'Missing semicolon. (semi)',
47   \ ale#balloon#MessageForPos(bufnr(''), 1, 1)
48
49 Execute(Balloon messages should be shown for earlier columns):
50   AssertEqual
51   \ 'Infix operators must be spaced. (space-infix-ops)',
52   \ ale#balloon#MessageForPos(bufnr(''), 2, 1)
53
54 Execute(Balloon messages should be shown for later columns):
55   AssertEqual
56   \ 'Missing radix parameter (radix)',
57   \ ale#balloon#MessageForPos(bufnr(''), 2, 16)
58
59 Execute(Balloon messages should be disabled if ALE is disabled globally):
60   let g:ale_enabled = 0
61   " Enabling the buffer should not make a difference.
62   let b:ale_enabled = 1
63
64   AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
65
66 Execute(Balloon messages should be disabled if ALE is disabled for a buffer):
67   let b:ale_enabled = 0
68
69   AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
70
71 Execute(Balloon messages should be disabled if the global setting is off):
72   let g:ale_set_balloons = 0
73
74   AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
75
76 Execute(Balloon messages should be disabled if the buffer setting is off):
77   let b:ale_set_balloons = 0
78
79   AssertEqual '', ale#balloon#MessageForPos(bufnr(''), 1, 1)
80
81 Execute(The balloon buffer setting should override the global one):
82   let g:ale_set_balloons = 0
83   let b:ale_set_balloons = 1
84
85   AssertEqual
86   \ 'Missing semicolon. (semi)',
87   \ ale#balloon#MessageForPos(bufnr(''), 1, 1)