summaryrefslogtreecommitdiff
path: root/test/test_results_not_cleared_when_opening_loclist.vader
blob: c586345a401d42097409c2a4a0b64dd46421cf44 (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
Before:
  Save g:ale_buffer_info

  call ale#linter#Reset()

After:
  Restore

  call setloclist(0, [])
  call clearmatches()
  call ale#sign#Clear()

Given foobar (Some file):
  abc

Execute(The loclist shouldn't be cleared when opening the loclist):
  call ale#engine#InitBufferInfo(bufnr(''))
  let g:ale_buffer_info[bufnr('')].loclist = [
  \ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
  \]
  call setloclist(0, g:ale_buffer_info[bufnr('')].loclist)

  " The cleanup function is called when the loclist window is closed.
  " If some cleanup is done for this buffer, for which nothing is wrong,
  " then the loclist for the window, which is the same window as the window
  " we are checking, will be cleared.
  :lopen
  :q

  AssertEqual 1, len(ale#test#GetLoclistWithoutNewerKeys()), 'The loclist was cleared'