MCPcopy Create free account
hub / github.com/facebook/time / TestStateString

Function TestStateString

servo/servo_test.go:25–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestStateString(t *testing.T) {
26 testCases := []struct {
27 state State
28 want string
29 }{
30 {StateInit, "INIT"},
31 {StateJump, "JUMP"},
32 {StateLocked, "LOCKED"},
33 {StateFilter, "FILTER"},
34 {StateHoldover, "HOLDOVER"},
35 {State(99), "UNSUPPORTED"},
36 }
37 for _, tc := range testCases {
38 t.Run(tc.want, func(t *testing.T) {
39 require.Equal(t, tc.want, tc.state.String())
40 })
41 }
42}
43
44func TestGetState(t *testing.T) {
45 pi := NewPiServo(DefaultServoConfig(), DefaultPiServoCfg(), -100000.0)

Callers

nothing calls this directly

Calls 3

StateTypeAlias · 0.85
RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…