(t *testing.T)
| 213 | } |
| 214 | |
| 215 | func 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 | } |