Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #276 from libp2p/test-testing
Browse files Browse the repository at this point in the history
add a test case for the testing package
  • Loading branch information
Stebalien authored Aug 27, 2021
2 parents 7b9c24a + 78d59ad commit 29bd937
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 1 addition & 2 deletions testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
quic "github.com/libp2p/go-libp2p-quic-transport"
swarm "github.com/libp2p/go-libp2p-swarm"
"github.com/libp2p/go-libp2p-testing/net"
tnet "github.com/libp2p/go-libp2p-testing/net"
tptu "github.com/libp2p/go-libp2p-transport-upgrader"
yamux "github.com/libp2p/go-libp2p-yamux"
msmux "github.com/libp2p/go-stream-muxer-multistream"
Expand Down Expand Up @@ -86,7 +86,6 @@ func GenUpgrader(n *swarm.Swarm) *tptu.Upgrader {
Secure: secMuxer,
Muxer: stMuxer,
}

}

// GenSwarm generates a new test swarm.
Expand Down
14 changes: 14 additions & 0 deletions testing/testing_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package testing

import (
"context"
"testing"

"github.com/stretchr/testify/require"
)

func TestGenSwarm(t *testing.T) {
swarm := GenSwarm(t, context.Background())
require.NoError(t, swarm.Close())
GenUpgrader(swarm)
}

0 comments on commit 29bd937

Please sign in to comment.