mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
Merge pull request #537 from nspcc-dev/feature/unit_binaryWrite
io: add missing test
This commit is contained in:
commit
bb5aba8f95
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