File: test_quickfix_deduplication.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (50 lines) | stat: -rw-r--r-- 2,487 bytes parent folder | download | duplicates (3)
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
Before:
  Save g:ale_buffer_info

After:
  Restore

Execute:
  " Results from multiple buffers should be gathered together.
  " Equal problems should be de-duplicated.
  let g:ale_buffer_info = {
  \ '1': {'loclist': [
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
  \   {'type': 'E', 'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
  \   {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
  \ ]},
  \ '2': {'loclist': [
  \   {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
  \ ]},
  \}

  AssertEqual
  \ [
  \   {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
  \   {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
  \   {'type': 'E', 'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
  \ ],
  \ ale#list#GetCombinedList()