forked from quic-go/quic-go
append to a byte slice instead of a bytes.Buffer when serializing frames
This commit is contained in:
@@ -47,17 +47,16 @@ var _ = Describe("STREAM_DATA_BLOCKED frame", func() {
|
||||
})
|
||||
|
||||
It("writes a sample frame", func() {
|
||||
b := &bytes.Buffer{}
|
||||
f := &StreamDataBlockedFrame{
|
||||
StreamID: 0xdecafbad,
|
||||
MaximumStreamData: 0x1337,
|
||||
}
|
||||
err := f.Write(b, protocol.Version1)
|
||||
b, err := f.Write(nil, protocol.Version1)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
expected := []byte{0x15}
|
||||
expected = append(expected, encodeVarInt(uint64(f.StreamID))...)
|
||||
expected = append(expected, encodeVarInt(uint64(f.MaximumStreamData))...)
|
||||
Expect(b.Bytes()).To(Equal(expected))
|
||||
Expect(b).To(Equal(expected))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user