diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_loclist_sorting.vader | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_loclist_sorting.vader b/test/test_loclist_sorting.vader new file mode 100644 index 00000000..fe4bc688 --- /dev/null +++ b/test/test_loclist_sorting.vader @@ -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 |