(t *testing.T)
| 910 | } |
| 911 | |
| 912 | func TestNewWithCustomRules(t *testing.T) { |
| 913 | opt := NewWithRules(&SelectStarRule{}) |
| 914 | if len(opt.Rules()) != 1 { |
| 915 | t.Errorf("expected 1 rule, got %d", len(opt.Rules())) |
| 916 | } |
| 917 | |
| 918 | result := mustAnalyze(t, opt, "SELECT * FROM users") |
| 919 | if !hasSuggestion(result, "OPT-001") { |
| 920 | t.Error("expected OPT-001 suggestion") |
| 921 | } |
| 922 | if hasSuggestion(result, "OPT-002") { |
| 923 | t.Error("OPT-002 should not be present with custom rules") |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | // --------------------------------------------------------------------------- |
| 928 | // FormatResult |
nothing calls this directly
no test coverage detected