MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestError_Unwrap

Function TestError_Unwrap

pkg/errors/errors_test.go:215–224  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestError_Unwrap(t *testing.T) {
216 causeErr := NewError(ErrCodeInvalidSyntax, "cause error", models.Location{})
217 err := NewError(ErrCodeUnexpectedToken, "wrapper error", models.Location{})
218 err.WithCause(causeErr)
219
220 unwrapped := err.Unwrap()
221 if unwrapped != causeErr {
222 t.Errorf("Unwrap() = %v, want %v", unwrapped, causeErr)
223 }
224}

Callers

nothing calls this directly

Calls 4

WithCauseMethod · 0.95
UnwrapMethod · 0.95
NewErrorFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected