summaryrefslogtreecommitdiff
path: root/test/test_results_not_cleared_when_opening_loclist.vader
blob: dd928fa04349f26671768f9bf404b4bee0845373 (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()
  sign unplace *

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(getloclist(0)), 'The loclist was cleared'