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

add a test case for the testing package #276

Merged
merged 1 commit into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}