This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/test_loclist_sorting.vader

21 lines
448 B
Text

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