Skip to content

Commit

Permalink
testutils: make the package public (#4290)
Browse files Browse the repository at this point in the history
This package can be useful outside of quic-go. We're not making any API
guarantees at this point.
  • Loading branch information
marten-seemann committed Jan 31, 2024
1 parent d330d2e commit da25787
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
mocklogging "github.com/quic-go/quic-go/internal/mocks/logging"
"github.com/quic-go/quic-go/internal/protocol"
"github.com/quic-go/quic-go/internal/qerr"
"github.com/quic-go/quic-go/internal/testutils"
"github.com/quic-go/quic-go/internal/utils"
"github.com/quic-go/quic-go/internal/wire"
"github.com/quic-go/quic-go/logging"
"github.com/quic-go/quic-go/testutils"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion integrationtests/self/mitm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/quic-go/quic-go"
quicproxy "github.com/quic-go/quic-go/integrationtests/tools/proxy"
"github.com/quic-go/quic-go/internal/protocol"
"github.com/quic-go/quic-go/internal/testutils"
"github.com/quic-go/quic-go/internal/wire"
"github.com/quic-go/quic-go/testutils"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
6 changes: 3 additions & 3 deletions internal/testutils/testutils.go → testutils/testutils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package testutils contains utilities for simulating packet injection and man-in-the-middle (MITM) attacker tests.
// It is not supposed to be used for non-testing purposes.
// The API is not guaranteed to be stable.
package testutils

import (
Expand All @@ -8,9 +11,6 @@ import (
"github.com/quic-go/quic-go/internal/wire"
)

// Utilities for simulating packet injection and man-in-the-middle (MITM) attacker tests.
// Do not use for non-testing purposes.

// writePacket returns a new raw packet with the specified header and payload
func writePacket(hdr *wire.ExtendedHeader, data []byte) []byte {
b, err := hdr.Append(nil, hdr.Version)
Expand Down

0 comments on commit da25787

Please sign in to comment.