move varint encoding / decoding to a separate package

... which is not internal.
This commit is contained in:
Marten Seemann 2021-01-01 11:37:19 +08:00
parent 602212e983
commit 11c5045065
47 changed files with 319 additions and 286 deletions

View file

@ -5,7 +5,8 @@ import (
"fmt"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/quicvarint"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@ -100,7 +101,7 @@ var _ = Describe("MAX_STREAMS frame", func() {
It("has the correct min length", func() {
frame := MaxStreamsFrame{MaxStreamNum: 0x1337}
Expect(frame.Length(protocol.VersionWhatever)).To(Equal(1 + utils.VarIntLen(0x1337)))
Expect(frame.Length(protocol.VersionWhatever)).To(Equal(1 + quicvarint.VarIntLen(0x1337)))
})
})
})