m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Change Merger implementation on --no-sort

This commit is contained in:
Junegunn Choi
2015-01-10 14:24:12 +09:00
parent 2d9b38b93e
commit 6e86fee588
2 changed files with 29 additions and 27 deletions

View File

@@ -19,6 +19,9 @@ func randItem() *Item {
func TestEmptyMerger(t *testing.T) {
assert(t, EmptyMerger.Length() == 0, "Not empty")
assert(t, EmptyMerger.count == 0, "Invalid count")
assert(t, len(EmptyMerger.lists) == 0, "Invalid lists")
assert(t, len(EmptyMerger.merged) == 0, "Invalid merged list")
}
func buildLists(partiallySorted bool) ([][]*Item, []*Item) {
@@ -72,7 +75,7 @@ func TestMergerSorted(t *testing.T) {
// Inverse order
mg2 := NewMerger(lists, true)
for i := cnt - 1; i >= cnt; i-- {
for i := cnt - 1; i >= 0; i-- {
if items[i] != mg2.Get(i) {
t.Error("Not sorted", items[i], mg2.Get(i))
}