Files
go-libp2p/leaky_tests/leaky_test.go
Marco Munizaga 86a6720a62 autonat: Clean up after close (#2749)
* Clean up after autonat

* Close
2024-03-27 20:14:32 -07:00

20 lines
357 B
Go

package leaky_test
import (
"strings"
"testing"
"github.com/libp2p/go-libp2p"
)
func TestBadTransportConstructor(t *testing.T) {
h, err := libp2p.New(libp2p.Transport(func() {}))
if err == nil {
h.Close()
t.Fatal("expected an error")
}
if !strings.Contains(err.Error(), "_test.go") {
t.Error("expected error to contain debugging info")
}
}