seekbuf: linter fixes
This commit is contained in:
@@ -1,18 +1,20 @@
|
|||||||
package seekbuf
|
package seekbuf_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/goutils/assert"
|
"git.wntrmute.dev/kyle/goutils/assert"
|
||||||
|
"git.wntrmute.dev/kyle/goutils/seekbuf"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSeeking(t *testing.T) {
|
func TestSeeking(t *testing.T) {
|
||||||
partA := []byte("hello, ")
|
partA := []byte("hello, ")
|
||||||
partB := []byte("world!")
|
partB := []byte("world!")
|
||||||
|
|
||||||
buf := New(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)))
|
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)
|
b := make([]byte, 32)
|
||||||
|
|
||||||
@@ -32,7 +34,8 @@ func TestSeeking(t *testing.T) {
|
|||||||
|
|
||||||
partsLen := len(partA) + len(partB)
|
partsLen := len(partA) + len(partB)
|
||||||
buf.Rewind()
|
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()
|
buf.Close()
|
||||||
assert.BoolT(t, buf.Len() == 0, fmt.Sprintf("after closing, have length %d, want length 0", buf.Len()))
|
assert.BoolT(t, buf.Len() == 0, fmt.Sprintf("after closing, have length %d, want length 0", buf.Len()))
|
||||||
|
|||||||
Reference in New Issue
Block a user