MCPcopy Create free account
hub / github.com/dadgar/onecache / TestStartRpcServerSpecificPort

Function TestStartRpcServerSpecificPort

onecache/onecache_test.go:35–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestStartRpcServerSpecificPort(t *testing.T) {
36 n := &Node{}
37
38 // A zero value port allows any port binding.
39 port := 9100
40 err := n.initRpcServer(port)
41
42 if err != nil {
43 t.Error(err)
44 }
45
46 if n.listener == nil {
47 t.Errorf("newRpcServer(%v) did not create a listener", port)
48 }
49
50 if n.port != port {
51 t.Errorf("newRpcServer(%v) bound to %v; want %v", port, n.port, port)
52 }
53}
54
55func TestStartRpcServerNegativePort(t *testing.T) {
56 n := &Node{}

Callers

nothing calls this directly

Calls 1

initRpcServerMethod · 0.95

Tested by

no test coverage detected