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 (
|
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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue