summaryrefslogtreecommitdiff
path: root/src/chunklist_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunklist_test.go')
-rw-r--r--src/chunklist_test.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/chunklist_test.go b/src/chunklist_test.go
index 2523675a..594daebb 100644
--- a/src/chunklist_test.go
+++ b/src/chunklist_test.go
@@ -12,7 +12,7 @@ func TestChunkList(t *testing.T) {
sortCriteria = []criterion{byMatchLen, byLength}
cl := NewChunkList(func(s []byte, i int) *Item {
- return &Item{text: util.ToChars(s), rank: buildEmptyRank(int32(i * 2))}
+ return &Item{text: util.ToChars(s), index: int32(i * 2)}
})
// Snapshot
@@ -41,11 +41,8 @@ func TestChunkList(t *testing.T) {
if len(*chunk1) != 2 {
t.Error("Snapshot should contain only two items")
}
- last := func(arr [5]int32) int32 {
- return arr[len(arr)-1]
- }
- if (*chunk1)[0].text.ToString() != "hello" || last((*chunk1)[0].rank) != 0 ||
- (*chunk1)[1].text.ToString() != "world" || last((*chunk1)[1].rank) != 2 {
+ if (*chunk1)[0].text.ToString() != "hello" || (*chunk1)[0].index != 0 ||
+ (*chunk1)[1].text.ToString() != "world" || (*chunk1)[1].index != 2 {
t.Error("Invalid data")
}
if chunk1.IsFull() {