uquic/internal/wire/wire_suite_test.go
Gaukas Wang 4973374ea5
sync: quic-go 0.42.0
Signed-off-by: Gaukas Wang <i@gaukas.wang>
2024-04-23 22:34:55 -06:00

28 lines
586 B
Go

package wire
import (
"encoding/binary"
"testing"
"github.com/refraction-networking/uquic/internal/protocol"
"github.com/refraction-networking/uquic/quicvarint"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestWire(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Wire Suite")
}
func encodeVarInt(i uint64) []byte {
return quicvarint.Append(nil, i)
}
func appendVersion(data []byte, v protocol.Version) []byte {
offset := len(data)
data = append(data, []byte{0, 0, 0, 0}...)
binary.BigEndian.PutUint32(data[offset:], uint32(v))
return data
}