MCPcopy Index your code
hub / github.com/passteque/gluetun / Test_Server_Run_failure

Function Test_Server_Run_failure

internal/httpserver/run_test.go:48–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func Test_Server_Run_failure(t *testing.T) {
49 t.Parallel()
50 ctrl := gomock.NewController(t)
51
52 logger := NewMockLogger(ctrl)
53 logger.EXPECT().Error("listen tcp: address -1: invalid port")
54
55 server := &Server{
56 address: "127.0.0.1:-1",
57 addressSet: make(chan struct{}),
58 logger: logger,
59 }
60
61 ready := make(chan struct{})
62 done := make(chan struct{})
63
64 go server.Run(context.Background(), ready, done)
65
66 select {
67 case <-ready:
68 t.Fatal("server should not be ready")
69 case _, ok := <-done:
70 assert.False(t, ok)
71 }
72}

Callers

nothing calls this directly

Calls 4

EXPECTMethod · 0.95
RunMethod · 0.95
NewMockLoggerFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected