Skip to content

Commit

Permalink
adjust test function relates to #55
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Aug 28, 2019
1 parent 67e00e8 commit b71f58e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions alloc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ func TestAllocPut(t *testing.T) {
func TestAllocPutThenGet(t *testing.T) {
alloc := NewAllocator()
data := alloc.Get(4)
for k := range data {
data[k] = 99
}
alloc.Put(data)

newData := alloc.Get(4)
for k := range newData {
if newData[k] != 99 {
t.Fatal("cannot fetch written []bytes from pool")
}
if cap(data) != cap(newData) {
t.Fatal("different cap while alloc.Get()")
}
}

Expand Down

0 comments on commit b71f58e

Please sign in to comment.