add support for QUIC v1

This commit is contained in:
Marten Seemann 2021-03-02 16:01:34 +08:00
parent b8f07c728c
commit 6b771df453
8 changed files with 25 additions and 12 deletions

View file

@ -17,6 +17,7 @@ var _ = Describe("Version", func() {
Expect(IsValidVersion(VersionDraft29)).To(BeFalse())
Expect(IsValidVersion(VersionDraft32)).To(BeFalse())
Expect(IsValidVersion(VersionDraft34)).To(BeFalse())
Expect(IsValidVersion(Version1)).To(BeFalse())
Expect(IsValidVersion(1234)).To(BeFalse())
})
@ -25,12 +26,12 @@ var _ = Describe("Version", func() {
})
It("has the right string representation", func() {
Expect(VersionTLS.String()).To(ContainSubstring("TLS"))
Expect(VersionWhatever.String()).To(Equal("whatever"))
Expect(VersionUnknown.String()).To(Equal("unknown"))
Expect(VersionDraft29.String()).To(Equal("draft-29"))
Expect(VersionDraft32.String()).To(Equal("draft-32"))
Expect(VersionDraft34.String()).To(Equal("draft-34"))
Expect(Version1.String()).To(Equal("v1"))
// check with unsupported version numbers from the wiki
Expect(VersionNumber(0x51303039).String()).To(Equal("gQUIC 9"))
Expect(VersionNumber(0x51303133).String()).To(Equal("gQUIC 13"))
@ -46,7 +47,7 @@ var _ = Describe("Version", func() {
})
It("has supported versions in sorted order", func() {
for i := 0; i < len(SupportedVersions)-1; i++ {
for i := 1; i < len(SupportedVersions)-1; i++ {
Expect(SupportedVersions[i]).To(BeNumerically(">", SupportedVersions[i+1]))
}
})