--------------------------------------------------------------------------- Helper to run AnalyzeSQL and fail on error ---------------------------------------------------------------------------
(t *testing.T, opt *Optimizer, sql string)
| 25 | // --------------------------------------------------------------------------- |
| 26 | |
| 27 | func mustAnalyze(t *testing.T, opt *Optimizer, sql string) *OptimizationResult { |
| 28 | t.Helper() |
| 29 | result, err := opt.AnalyzeSQL(sql) |
| 30 | if err != nil { |
| 31 | t.Fatalf("AnalyzeSQL(%q) returned unexpected error: %v", sql, err) |
| 32 | } |
| 33 | return result |
| 34 | } |
| 35 | |
| 36 | func hasSuggestion(result *OptimizationResult, ruleID string) bool { |
| 37 | for _, s := range result.Suggestions { |
no test coverage detected