mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-17 03:21:27 +08:00
Add a unit test for the loclist comparison function.
This commit is contained in:
1 parent
5ca7cc14f3
commit
f506887b28
3 files changed
+42
-21
No files matched your search
@@ -0,0 +1,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 g:loclist, [
|
||||
\ {'lnum': 2, 'col': 10},
|
||||
\ {'lnum': 3, 'col': 2},
|
||||
\ {'lnum': 5, 'col': 4},
|
||||
\ {'lnum': 5, 'col': 5},
|
||||
\]
|
||||
|
||||
After:
|
||||
unlet g:loclist
|
||||
Reference in new issue
Block a user