| 86 | } |
| 87 | |
| 88 | func 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 | |
| 105 | func TestInternalError(t *testing.T) { |
| 106 | e := InternalError{} |