(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestPluginError(t *testing.T) { |
| 13 | err := newPluginError("new error") |
| 14 | assert.Check(t, is.Error(err, "new error")) |
| 15 | |
| 16 | inner := errors.New("testing") |
| 17 | err = wrapAsPluginError(inner, "wrapping") |
| 18 | assert.Check(t, is.Error(err, "wrapping: testing")) |
| 19 | assert.Check(t, is.ErrorIs(err, inner)) |
| 20 | |
| 21 | actual, err := json.Marshal(err) |
| 22 | assert.Check(t, err) |
| 23 | assert.Check(t, is.Equal(`"wrapping: testing"`, string(actual))) |
| 24 | |
| 25 | err = wrapAsPluginError(nil, "wrapping") |
| 26 | assert.Check(t, is.Error(err, "wrapping: %!w(<nil>)")) |
| 27 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…