MCPcopy Index your code
hub / github.com/docker/docker-agent / TestState_String

Function TestState_String

pkg/tools/lifecycle/state_test.go:14–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestState_String(t *testing.T) {
15 t.Parallel()
16
17 cases := []struct {
18 state lifecycle.State
19 want string
20 }{
21 {lifecycle.StateStopped, "stopped"},
22 {lifecycle.StateStarting, "starting"},
23 {lifecycle.StateReady, "ready"},
24 {lifecycle.StateDegraded, "degraded"},
25 {lifecycle.StateRestarting, "restarting"},
26 {lifecycle.StateFailed, "failed"},
27 {lifecycle.State(99), "state(99)"},
28 {lifecycle.State(-1), "state(-1)"}, // must not panic on negative
29 }
30 for _, tc := range cases {
31 assert.Check(t, is.Equal(tc.state.String(), tc.want))
32 }
33}
34
35func TestState_IsTerminal(t *testing.T) {
36 t.Parallel()

Callers

nothing calls this directly

Calls 3

StateTypeAlias · 0.92
CheckMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected