--------------------------------------------------------------------------- Nil AST / edge cases ---------------------------------------------------------------------------
(t *testing.T)
| 895 | // --------------------------------------------------------------------------- |
| 896 | |
| 897 | func TestAnalyzeNilAST(t *testing.T) { |
| 898 | opt := New() |
| 899 | |
| 900 | result := opt.Analyze(nil) |
| 901 | if result == nil { |
| 902 | t.Fatal("expected non-nil result for nil AST") |
| 903 | } |
| 904 | if len(result.Suggestions) != 0 { |
| 905 | t.Errorf("expected 0 suggestions for nil AST, got %d", len(result.Suggestions)) |
| 906 | } |
| 907 | if result.Score != 100 { |
| 908 | t.Errorf("expected score 100 for nil AST, got %d", result.Score) |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | func TestNewWithCustomRules(t *testing.T) { |
| 913 | opt := NewWithRules(&SelectStarRule{}) |