You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
357 B

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")
}
}