github.com/MerlinKodo/quic-go@v0.39.2/internal/qtls/go120_test.go (about)

     1  //go:build !go1.21
     2  
     3  package qtls
     4  
     5  import (
     6  	"github.com/MerlinKodo/quic-go/internal/protocol"
     7  
     8  	"github.com/quic-go/qtls-go1-20"
     9  
    10  	. "github.com/onsi/ginkgo/v2"
    11  	. "github.com/onsi/gomega"
    12  )
    13  
    14  var _ = Describe("Go 1.20", func() {
    15  	It("converts to qtls.EncryptionLevel", func() {
    16  		Expect(ToTLSEncryptionLevel(protocol.EncryptionInitial)).To(Equal(qtls.QUICEncryptionLevelInitial))
    17  		Expect(ToTLSEncryptionLevel(protocol.EncryptionHandshake)).To(Equal(qtls.QUICEncryptionLevelHandshake))
    18  		Expect(ToTLSEncryptionLevel(protocol.Encryption1RTT)).To(Equal(qtls.QUICEncryptionLevelApplication))
    19  		Expect(ToTLSEncryptionLevel(protocol.Encryption0RTT)).To(Equal(qtls.QUICEncryptionLevelEarly))
    20  	})
    21  
    22  	It("converts from qtls.EncryptionLevel", func() {
    23  		Expect(FromTLSEncryptionLevel(qtls.QUICEncryptionLevelInitial)).To(Equal(protocol.EncryptionInitial))
    24  		Expect(FromTLSEncryptionLevel(qtls.QUICEncryptionLevelHandshake)).To(Equal(protocol.EncryptionHandshake))
    25  		Expect(FromTLSEncryptionLevel(qtls.QUICEncryptionLevelApplication)).To(Equal(protocol.Encryption1RTT))
    26  		Expect(FromTLSEncryptionLevel(qtls.QUICEncryptionLevelEarly)).To(Equal(protocol.Encryption0RTT))
    27  	})
    28  })