]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_list_titles.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_list_titles.vader
1 Before:
2   Save g:ale_set_loclist
3   Save g:ale_set_quickfix
4   Save g:ale_buffer_info
5   Save g:ale_set_lists_synchronously
6
7   let g:ale_buffer_info = {}
8   let g:ale_set_loclist = 0
9   let g:ale_set_quickfix = 0
10   let g:ale_set_lists_synchronously = 1
11
12   call ale#test#SetDirectory('/testplugin/test')
13
14 After:
15   Restore
16
17   call setloclist(0, [])
18   call setqflist([])
19
20   call ale#test#RestoreDirectory()
21
22 Execute(The loclist titles should be set appropriately):
23   silent noautocmd file foo
24
25   let g:ale_set_loclist = 1
26
27   call ale#list#SetLists(bufnr(''), [
28   \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
29   \])
30
31   AssertEqual [{
32   \ 'lnum': 5,
33   \ 'bufnr': bufnr(''),
34   \ 'col': 5,
35   \ 'text': 'x',
36   \ 'valid': 1,
37   \ 'vcol': 0,
38   \ 'nr': 0,
39   \ 'type': 'E',
40   \ 'pattern': '',
41   \}], ale#test#GetLoclistWithoutNewerKeys()
42
43   if !has('nvim')
44     AssertEqual
45     \ {'title': ale#path#Simplify(getcwd() . '/foo')},
46     \ getloclist(0, {'title': ''})
47   endif
48
49 Execute(The quickfix titles should be set appropriately):
50   silent noautocmd file foo
51
52   let g:ale_set_quickfix = 1
53
54   let g:ale_buffer_info[bufnr('')] = {
55   \ 'loclist': [{'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'}],
56   \}
57
58   call ale#list#SetLists(bufnr(''), [
59   \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
60   \])
61   AssertEqual [{
62   \ 'lnum': 5,
63   \ 'bufnr': bufnr(''),
64   \ 'col': 5,
65   \ 'text': 'x',
66   \ 'valid': 1,
67   \ 'vcol': 0,
68   \ 'nr': 0,
69   \ 'type': 'E',
70   \ 'pattern': '',
71   \}], ale#test#GetQflistWithoutNewerKeys()
72
73   if !has('nvim')
74     AssertEqual
75     \ {'title': ale#path#Simplify(getcwd() . '/foo')},
76     \ getqflist({'title': ''})
77   endif