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

Function TestAsyncError

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

Source from the content-addressed store, hash-verified

86}
87
88func TestAsyncError(t *testing.T) {
89 e := AsyncError{}
90 if e.Error() != "async started" {
91 t.Error("AsyncError string mismatch")
92 }
93 e.Err = errors.New("async")
94 if e.Error() != "async started with error: "+e.Err.Error() {
95 t.Error("AsyncError string mismatch")
96 }
97 if e.Unwrap() == nil {
98 t.Error("AsyncError Unwrap() should not be nil")
99 }
100 if !errors.Is(e, e.Err) {
101 t.Error("AsyncError should be equal to its error")
102 }
103}
104
105func TestInternalError(t *testing.T) {
106 e := InternalError{}

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.95
UnwrapMethod · 0.95
IsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…