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

Function TestIncompleteStatementError

pkg/errors/builders_test.go:181–195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestIncompleteStatementError(t *testing.T) {
182 sql := "SELECT * FROM"
183 location := models.Location{Line: 1, Column: 14}
184
185 err := IncompleteStatementError(location, sql)
186
187 if err.Code != ErrCodeIncompleteStatement {
188 t.Errorf("IncompleteStatementError() code = %v, want %v", err.Code, ErrCodeIncompleteStatement)
189 }
190
191 output := err.Error()
192 if !strings.Contains(output, "incomplete SQL statement") {
193 t.Errorf("Error should mention incomplete statement, got: %s", output)
194 }
195}
196
197func TestWrapError(t *testing.T) {
198 sql := "SELECT * FROM users"

Callers

nothing calls this directly

Calls 3

IncompleteStatementErrorFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected