github.com/danielpfeifer02/quic-go-prio-packs@v0.41.0-28/internal/ackhandler/ack_eliciting_test.go (about)

     1  package ackhandler
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/danielpfeifer02/quic-go-prio-packs/internal/wire"
     7  
     8  	. "github.com/onsi/ginkgo/v2"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  var _ = Describe("ack-eliciting frames", func() {
    13  	for fl, el := range map[wire.Frame]bool{
    14  		&wire.AckFrame{}:             false,
    15  		&wire.ConnectionCloseFrame{}: false,
    16  		&wire.DataBlockedFrame{}:     true,
    17  		&wire.PingFrame{}:            true,
    18  		&wire.ResetStreamFrame{}:     true,
    19  		&wire.StreamFrame{}:          true,
    20  		&wire.MaxDataFrame{}:         true,
    21  		&wire.MaxStreamDataFrame{}:   true,
    22  	} {
    23  		f := fl
    24  		e := el
    25  		fName := reflect.ValueOf(f).Elem().Type().Name()
    26  
    27  		It("works for "+fName, func() {
    28  			Expect(IsFrameAckEliciting(f)).To(Equal(e))
    29  		})
    30  
    31  		It("HasAckElicitingFrames works for "+fName, func() {
    32  			Expect(HasAckElicitingFrames([]Frame{{Frame: f}})).To(Equal(e))
    33  		})
    34  	}
    35  })