github.com/tumi8/quic-go@v0.37.4-tum/noninternal/wire/wire_suite_test.go (about) 1 package wire 2 3 import ( 4 "encoding/binary" 5 "testing" 6 7 "github.com/tumi8/quic-go/noninternal/protocol" 8 "github.com/tumi8/quic-go/quicvarint" 9 10 . "github.com/onsi/ginkgo/v2" 11 . "github.com/onsi/gomega" 12 ) 13 14 func TestWire(t *testing.T) { 15 RegisterFailHandler(Fail) 16 RunSpecs(t, "Wire Suite") 17 } 18 19 func encodeVarInt(i uint64) []byte { 20 return quicvarint.Append(nil, i) 21 } 22 23 func appendVersion(data []byte, v protocol.VersionNumber) []byte { 24 offset := len(data) 25 data = append(data, []byte{0, 0, 0, 0}...) 26 binary.BigEndian.PutUint32(data[offset:], uint32(v)) 27 return data 28 }