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

Function TestCanceledError

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

Source from the content-addressed store, hash-verified

69}
70
71func TestCanceledError(t *testing.T) {
72 e := CanceledError{}
73 if e.Error() != "transition canceled" {
74 t.Error("CanceledError string mismatch")
75 }
76 e.Err = errors.New("canceled")
77 if e.Error() != "transition canceled with error: "+e.Err.Error() {
78 t.Error("CanceledError string mismatch")
79 }
80 if e.Unwrap() == nil {
81 t.Error("CanceledError Unwrap() should not be nil")
82 }
83 if !errors.Is(e, e.Err) {
84 t.Error("CanceledError should be equal to its error")
85 }
86}
87
88func TestAsyncError(t *testing.T) {
89 e := AsyncError{}

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…