From 78d59adc112f04fe2030982e70662874bc238216 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 27 Aug 2021 11:54:25 +0100 Subject: [PATCH] add a test case for the testing package --- testing/testing.go | 3 +-- testing/testing_test.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 testing/testing_test.go diff --git a/testing/testing.go b/testing/testing.go index 313e3d77..ba517769 100644 --- a/testing/testing.go +++ b/testing/testing.go @@ -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" @@ -86,7 +86,6 @@ func GenUpgrader(n *swarm.Swarm) *tptu.Upgrader { Secure: secMuxer, Muxer: stMuxer, } - } // GenSwarm generates a new test swarm. diff --git a/testing/testing_test.go b/testing/testing_test.go new file mode 100644 index 00000000..a80cca17 --- /dev/null +++ b/testing/testing_test.go @@ -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) +}