Skip to content

Commit

Permalink
test: length check
Browse files Browse the repository at this point in the history
  • Loading branch information
ppzqh committed Sep 16, 2024
1 parent 59ee037 commit c4d6e92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions container/strstore/strstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ func TestStrStore(t *testing.T) {
// test when the pages grow
ss := randStrings(50, 1000000)
strStore, idxes := New(ss)
totalLen := 0
for i := 0; i < len(ss); i++ {
assert.Equal(t, ss[i], strStore.Get(idxes[i]))
totalLen += len(ss[i])
}
assert.Equal(t, totalLen+strlenSize*len(ss), strStore.Len())
s := strStore.Get(-1)
assert.Equal(t, "", s)
s = strStore.Get(strStore.Len() * 2)
Expand Down

0 comments on commit c4d6e92

Please sign in to comment.