Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
cli: add test for protocolNotSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed May 10, 2019
1 parent 98f9030 commit 9c3b635
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/cli/run_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package cli

import (
"io"
"io/ioutil"
"net"
"net/http"
"os"
"sync"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -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)
}
}

0 comments on commit 9c3b635

Please sign in to comment.