summaryrefslogtreecommitdiff
path: root/test/test_set_list_timers.vader
blob: 90aacb552c77147669185eff06961432e1d93b1e (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
Before:
  Save g:ale_set_lists_synchronously
  Save g:ale_open_list

  let g:ale_set_lists_synchronously = 0

After:
  Restore

  sleep 1ms
  call setloclist(0, [])
  lclose

Execute(The SetLists function should work when run in a timer):
  call ale#list#SetLists(bufnr(''), [
  \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
  \])
  sleep 1ms
  AssertEqual [{
  \ 'lnum': 5,
  \ 'bufnr': bufnr(''),
  \ 'col': 5,
  \ 'text': 'x',
  \ 'valid': 1,
  \ 'vcol': 0,
  \ 'nr': 0,
  \ 'type': 'E',
  \ 'pattern': '',
  \}], getloclist(0)

Execute(The CloseWindowIfNeeded function should work when run in a timer):
  let g:ale_open_list = 1
  lopen

  call ale#list#CloseWindowIfNeeded(bufnr(''))
  sleep 1ms

  Assert !ale#list#IsQuickfixOpen(), 'The window was not closed!'