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