MCPcopy Index your code
hub / github.com/screego/server / TestShutdownAfterError

Function TestShutdownAfterError

server/server_test.go:39–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestShutdownAfterError(t *testing.T) {
40 finished := make(chan error)
41
42 go func() {
43 finished <- Start(mux.NewRouter(), ":-5", "", "")
44 }()
45
46 select {
47 case <-time.After(1 * time.Second):
48 t.Fatal("Server should be closed")
49 case err := <-finished:
50 assert.NotNil(t, err)
51 }
52}
53
54func TestShutdown(t *testing.T) {
55 dispose := fakeInterrupt(t)

Callers

nothing calls this directly

Calls 1

StartFunction · 0.70

Tested by

no test coverage detected