diff --git a/internal/cli/run_test.go b/internal/cli/run_test.go index aa0d4b0..76c14fc 100644 --- a/internal/cli/run_test.go +++ b/internal/cli/run_test.go @@ -1,10 +1,13 @@ package cli import ( + "io" "io/ioutil" + "net" "net/http" "os" "sync" + "syscall" "testing" "time" @@ -238,3 +241,13 @@ func TestNormalize(t *testing.T) { } } } + +func TestProtocolNotSupported(t *testing.T) { + if protocolNotSupported(io.EOF) { + t.Error("EOF considered as protocol not supported") + } + err := &net.OpError{Op: "listen", Err: syscall.EPROTONOSUPPORT} + if !protocolNotSupported(err) { + t.Errorf("result for %v should be true", err) + } +}