(t *testing.T)
| 354 | } |
| 355 | |
| 356 | func 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 | |
| 383 | func TestCommonMistakePatterns(t *testing.T) { |
| 384 | // Verify all common mistakes have complete information |
nothing calls this directly
no test coverage detected