summaryrefslogtreecommitdiff
path: root/test/test_loclist_sorting.vader
blob: 6e52be6f6df217c393f1cac4fb124206377629b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Before:
  let g:loclist = [
  \ {'lnum': 5, 'col': 5},
  \ {'lnum': 5, 'col': 4},
  \ {'lnum': 2, 'col': 10},
  \ {'lnum': 3, 'col': 2},
  \]

Execute (Sort loclist with comparison function):
  call sort(g:loclist, 'ale#util#LocItemCompare')

Then (loclist item should be sorted):
  AssertEqual [
  \ {'lnum': 2, 'col': 10},
  \ {'lnum': 3, 'col': 2},
  \ {'lnum': 5, 'col': 4},
  \ {'lnum': 5, 'col': 5},
  \], g:loclist

After:
  unlet g:loclist