Fix serializer test
This commit is contained in:
parent
96f0b64a11
commit
edad47b568
1 changed files with 4 additions and 5 deletions
|
@ -2,7 +2,6 @@ package sbhpfv1_test
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
|
@ -90,13 +89,13 @@ func TestNodeSerialization(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
w := io.WriteSeeker{}
|
||||
err := sbhpfv1.SerializeNode(buf, &node)
|
||||
var w bytes.Buffer
|
||||
err := sbhpfv1.SerializeNodeStream(&w, &node)
|
||||
if err != nil {
|
||||
t.Fatalf("Node serialization failed: %v", err)
|
||||
}
|
||||
|
||||
if !slices.Equal(buf.Bytes(), node_ser_targetbytes) {
|
||||
t.Fatalf("Node serialization generated bad data: %v", buf.Bytes())
|
||||
if !slices.Equal(w.Bytes(), node_ser_targetbytes) {
|
||||
t.Fatalf("Node serialization generated bad data: %v", w.Bytes())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue