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

Function TestFormatMistakeExample

pkg/errors/suggestions_test.go:356–381  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

354}
355
356func TestFormatMistakeExample(t *testing.T) {
357 mistake := MistakePattern{
358 Name: "test_mistake",
359 Example: "SELECT * FORM users",
360 Correct: "SELECT * FROM users",
361 Explanation: "FROM is the correct keyword",
362 }
363
364 got := FormatMistakeExample(mistake)
365
366 requiredParts := []string{
367 "test_mistake",
368 "SELECT * FORM users",
369 "SELECT * FROM users",
370 "FROM is the correct keyword",
371 "Wrong:",
372 "Right:",
373 "Explanation:",
374 }
375
376 for _, part := range requiredParts {
377 if !strings.Contains(got, part) {
378 t.Errorf("FormatMistakeExample() should contain %q, got:\n%s", part, got)
379 }
380 }
381}
382
383func TestCommonMistakePatterns(t *testing.T) {
384 // Verify all common mistakes have complete information

Callers

nothing calls this directly

Calls 2

FormatMistakeExampleFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected