forked from TrueCloudLab/neoneo-go
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)
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
// EncodeBinary implements io.Serializable interface.
|
||||
|
|
Loading…
Reference in a new issue