uquic/internal/wire/version_negotiation_test.go
2017-08-30 00:19:44 +07:00

17 lines
466 B
Go

package wire
import (
"github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Version Negotiation Packet", func() {
It("composes version negotiation packets", func() {
expected := append(
[]byte{0x01 | 0x08, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
[]byte{'Q', '0', '9', '9'}...,
)
Expect(ComposeVersionNegotiation(1, []protocol.VersionNumber{99})).To(Equal(expected))
})
})