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 ( import (
"bytes" "bytes"
"io"
"slices" "slices"
"testing" "testing"
@ -90,13 +89,13 @@ func TestNodeSerialization(t *testing.T) {
}, },
} }
w := io.WriteSeeker{} var w bytes.Buffer
err := sbhpfv1.SerializeNode(buf, &node) err := sbhpfv1.SerializeNodeStream(&w, &node)
if err != nil { if err != nil {
t.Fatalf("Node serialization failed: %v", err) t.Fatalf("Node serialization failed: %v", err)
} }
if !slices.Equal(buf.Bytes(), node_ser_targetbytes) { if !slices.Equal(w.Bytes(), node_ser_targetbytes) {
t.Fatalf("Node serialization generated bad data: %v", buf.Bytes()) t.Fatalf("Node serialization generated bad data: %v", w.Bytes())
} }
} }