package tcp import ( "testing" utils "github.com/libp2p/go-libp2p-transport/test" ma "github.com/multiformats/go-multiaddr" ) func TestTcpTransport(t *testing.T) { ta := NewTCPTransport() tb := NewTCPTransport() zero := "/ip4/127.0.0.1/tcp/0" utils.SubtestTransport(t, ta, tb, zero) } func TestTcpTransportCantListenUtp(t *testing.T) { utpa, err := ma.NewMultiaddr("/ip4/127.0.0.1/udp/0/utp") if err != nil { t.Fatal(err) } tpt := NewTCPTransport() _, err = tpt.Listen(utpa) if err == nil { t.Fatal("shouldnt be able to listen on utp addr with tcp transport") } }