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

Function TestIsStructuredError

pkg/errors/formatter_test.go:440–455  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

438}
439
440func TestIsStructuredError(t *testing.T) {
441 structErr := NewError(ErrCodeUnexpectedToken, "test", models.Location{})
442 simpleErr := fmt.Errorf("simple error")
443
444 if !IsStructuredError(structErr) {
445 t.Error("IsStructuredError() should return true for structured error")
446 }
447
448 if IsStructuredError(simpleErr) {
449 t.Error("IsStructuredError() should return false for simple error")
450 }
451
452 if IsStructuredError(nil) {
453 t.Error("IsStructuredError() should return false for nil")
454 }
455}
456
457func TestExtractLocation(t *testing.T) {
458 location := models.Location{Line: 5, Column: 10}

Callers

nothing calls this directly

Calls 4

IsStructuredErrorFunction · 0.85
NewErrorFunction · 0.70
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected