MCPcopy
hub / github.com/looplab/fsm / TestNoTransitionError

Function TestNoTransitionError

errors_test.go:54–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestNoTransitionError(t *testing.T) {
55 e := NoTransitionError{}
56 if e.Error() != "no transition" {
57 t.Error("NoTransitionError string mismatch")
58 }
59 e.Err = errors.New("no transition")
60 if e.Error() != "no transition with error: "+e.Err.Error() {
61 t.Error("NoTransitionError string mismatch")
62 }
63 if e.Unwrap() == nil {
64 t.Error("CanceledError Unwrap() should not be nil")
65 }
66 if !errors.Is(e, e.Err) {
67 t.Error("CanceledError should be equal to its error")
68 }
69}
70
71func TestCanceledError(t *testing.T) {
72 e := CanceledError{}

Callers

nothing calls this directly

Calls 4

ErrorMethod · 0.95
UnwrapMethod · 0.95
IsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…