uquic/public_reset_test.go
2016-05-17 19:24:49 +02:00

25 lines
612 B
Go

package quic
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("public reset", func() {
Context("writing", func() {
It("writes public reset packets", func() {
Expect(writePublicReset(0xdeadbeef, 0x8badf00d, 0xdecafbad)).To(Equal([]byte{
0x0a,
0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00,
'P', 'R', 'S', 'T',
0x02, 0x00, 0x00, 0x00,
'R', 'N', 'O', 'N',
0x08, 0x00, 0x00, 0x00,
'R', 'S', 'E', 'Q',
0x10, 0x00, 0x00, 0x00,
0xad, 0xfb, 0xca, 0xde, 0x0, 0x0, 0x0, 0x0,
0x0d, 0xf0, 0xad, 0x8b, 0x0, 0x0, 0x0, 0x0,
}))
})
})
})