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

  let g:ale_buffer_info = {
  \ bufnr(''): {
  \   'loclist': [{'bufnr': bufnr(''), 'lnum': 4, 'col': 1, 'text': 'foo'}]
  \ },
  \}

  let g:original_buffer = bufnr('%')
  noautocmd new

After:
  Restore

  unlet! g:original_buffer

Execute(Errors should be set in the loclist for the original buffer, not the new one):
  call ale#list#SetLists(
  \ g:original_buffer,
  \ g:ale_buffer_info[(g:original_buffer)].loclist,
  \ )

  AssertEqual [], ale#test#GetLoclistWithoutModule()
  AssertEqual 1, len(getloclist(bufwinid(g:original_buffer)))
  AssertEqual 'foo', getloclist(bufwinid(g:original_buffer))[0].text