23 lines
375 B
Go
23 lines
375 B
Go
package tests
|
|
|
|
import (
|
|
"bytes"
|
|
"lux/types"
|
|
"testing"
|
|
)
|
|
|
|
func TestWriteGrow(t *testing.T) {
|
|
first, second := []byte{1, 2, 3, 4}, []byte{5, 6, 7, 8}
|
|
must := []byte{1, 2, 3, 4, 5, 6, 7, 8}
|
|
|
|
buf := types.NewLuxBuffer(4)
|
|
buf.WriteBytes(first)
|
|
t.Log(buf.AllBytes())
|
|
|
|
buf.WriteBytes(second)
|
|
t.Log(buf.AllBytes())
|
|
|
|
if !bytes.Equal(must, buf.AllBytes()) {
|
|
t.Fail()
|
|
}
|
|
}
|