summaryrefslogtreecommitdiff
path: root/test/test_list_titles.vader
blob: fe28629de5770348b244c43807d8443e6b5b2b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Before:
  Save g:ale_set_loclist
  Save g:ale_set_quickfix

  let g:ale_set_loclist = 0
  let g:ale_set_quickfix = 0

  silent! cd /testplugin/test

After:
  Restore

  call setloclist(0, [])
  call setqflist([])

Execute(The loclist titles should be set appropriately):
  silent noautocmd file foo

  let g:ale_set_loclist = 1

  call ale#list#SetLists(bufnr(''), [
  \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
  \])

  AssertEqual [{
  \ 'lnum': 5,
  \ 'bufnr': bufnr(''),
  \ 'col': 5,
  \ 'text': 'x',
  \ 'valid': 1,
  \ 'vcol': 0,
  \ 'nr': 0,
  \ 'type': 'E',
  \ 'pattern': '',
  \}], getloclist(0)

  if !has('nvim')
    AssertEqual {'title': getcwd() . '/foo'}, getloclist(0, {'title': ''})
  endif

Execute(The quickfix titles should be set appropriately):
  silent noautocmd file foo

  let g:ale_set_quickfix = 1

  call ale#list#SetLists(bufnr(''), [
  \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
  \])
  AssertEqual [{
  \ 'lnum': 5,
  \ 'bufnr': bufnr(''),
  \ 'col': 5,
  \ 'text': 'x',
  \ 'valid': 1,
  \ 'vcol': 0,
  \ 'nr': 0,
  \ 'type': 'E',
  \ 'pattern': '',
  \}], getqflist()

  if !has('nvim')
    AssertEqual {'title': getcwd() . '/foo'}, getqflist({'title': ''})
  endif