seekbuf: linter fixes

This commit is contained in:
2025-11-15 19:58:41 -08:00
parent fdff2e0afe
commit 66d16acebc

View File

@@ -1,18 +1,20 @@
package seekbuf
package seekbuf_test
import (
"fmt"
"testing"
"git.wntrmute.dev/kyle/goutils/assert"
"git.wntrmute.dev/kyle/goutils/seekbuf"
)
func TestSeeking(t *testing.T) {
partA := []byte("hello, ")
partB := []byte("world!")
buf := New(partA)
assert.BoolT(t, buf.Len() == len(partA), fmt.Sprintf("on init: have length %d, want length %d", buf.Len(), len(partA)))
buf := seekbuf.New(partA)
assert.BoolT(t, buf.Len() == len(partA),
fmt.Sprintf("on init: have length %d, want length %d", buf.Len(), len(partA)))
b := make([]byte, 32)
@@ -32,7 +34,8 @@ func TestSeeking(t *testing.T) {
partsLen := len(partA) + len(partB)
buf.Rewind()
assert.BoolT(t, buf.Len() == partsLen, fmt.Sprintf("after rewinding: have length %d, want length %d", buf.Len(), partsLen))
assert.BoolT(t, buf.Len() == partsLen,
fmt.Sprintf("after rewinding: have length %d, want length %d", buf.Len(), partsLen))
buf.Close()
assert.BoolT(t, buf.Len() == 0, fmt.Sprintf("after closing, have length %d, want length 0", buf.Len()))