mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
io: add missing test
This commit is contained in:
parent
f48228ef7d
commit
5a41da0e1a
1 changed files with 12 additions and 0 deletions
|
@ -200,6 +200,18 @@ func TestWriteVarUint100000000000(t *testing.T) {
|
||||||
assert.Equal(t, val, res)
|
assert.Equal(t, val, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestWriteBytes(t *testing.T) {
|
||||||
|
var (
|
||||||
|
bin = []byte{0xde, 0xad, 0xbe, 0xef}
|
||||||
|
)
|
||||||
|
bw := NewBufBinWriter()
|
||||||
|
bw.WriteBytes(bin)
|
||||||
|
assert.Nil(t, bw.Err)
|
||||||
|
buf := bw.Bytes()
|
||||||
|
assert.Equal(t, 4, len(buf))
|
||||||
|
assert.Equal(t, byte(0xde), buf[0])
|
||||||
|
}
|
||||||
|
|
||||||
type testSerializable uint16
|
type testSerializable uint16
|
||||||
|
|
||||||
// EncodeBinary implements io.Serializable interface.
|
// EncodeBinary implements io.Serializable interface.
|
||||||
|
|
Loading…
Reference in a new issue