Add --tiebreak option for customizing sort criteria

Close #191
This commit is contained in:
Junegunn Choi
2015-04-16 14:19:28 +09:00
parent 48ab87294b
commit b8904a8c3e
7 changed files with 139 additions and 18 deletions

View File

@@ -42,7 +42,7 @@ func TestItemRank(t *testing.T) {
strs := []string{"foo", "foobar", "bar", "baz"}
item1 := Item{text: &strs[0], index: 1, offsets: []Offset{}}
rank1 := item1.Rank(true)
if rank1.matchlen != 0 || rank1.strlen != 3 || rank1.index != 1 {
if rank1.matchlen != 0 || rank1.tiebreak != 3 || rank1.index != 1 {
t.Error(item1.Rank(true))
}
// Only differ in index