Fix serializer test

This commit is contained in:
zervo 2025-02-14 12:04:11 +01:00
parent 96f0b64a11
commit edad47b568

View file

@ -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())
}
}