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

Function BenchmarkFormatErrorWithContext

pkg/errors/formatter_test.go:570–579  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

568}
569
570func BenchmarkFormatErrorWithContext(b *testing.B) {
571 err := NewError(ErrCodeUnexpectedToken, "unexpected token", models.Location{Line: 1, Column: 10}).
572 WithContext("SELECT * FORM users WHERE age > 18", 4)
573 sql := "SELECT * FORM users WHERE age > 18"
574
575 b.ResetTimer()
576 for i := 0; i < b.N; i++ {
577 _ = FormatErrorWithContext(err, sql)
578 }
579}
580
581func BenchmarkFormatMultiLineContext(b *testing.B) {
582 sql := `SELECT id, name, email

Callers

nothing calls this directly

Calls 3

FormatErrorWithContextFunction · 0.85
NewErrorFunction · 0.70
WithContextMethod · 0.45

Tested by

no test coverage detected