github.com/apernet/quic-go@v0.43.1-0.20240515053213-5e9e635fd9f0/internal/wire/pool_test.go (about)

     1  package wire
     2  
     3  import (
     4  	. "github.com/onsi/ginkgo/v2"
     5  	. "github.com/onsi/gomega"
     6  )
     7  
     8  var _ = Describe("Pool", func() {
     9  	It("gets and puts STREAM frames", func() {
    10  		f := GetStreamFrame()
    11  		putStreamFrame(f)
    12  	})
    13  
    14  	It("panics when putting a STREAM frame with a wrong capacity", func() {
    15  		f := GetStreamFrame()
    16  		f.Data = []byte("foobar")
    17  		Expect(func() { putStreamFrame(f) }).To(Panic())
    18  	})
    19  
    20  	It("accepts STREAM frames not from the buffer, but ignores them", func() {
    21  		f := &StreamFrame{Data: []byte("foobar")}
    22  		putStreamFrame(f)
    23  	})
    24  })