(t *testing.T)
| 141 | } |
| 142 | |
| 143 | func TestInvalidSyntaxError(t *testing.T) { |
| 144 | sql := "SELECT * FROM WHERE" |
| 145 | location := models.Location{Line: 1, Column: 15} |
| 146 | |
| 147 | err := InvalidSyntaxError("missing table name", location, sql) |
| 148 | |
| 149 | if err.Code != ErrCodeInvalidSyntax { |
| 150 | t.Errorf("InvalidSyntaxError() code = %v, want %v", err.Code, ErrCodeInvalidSyntax) |
| 151 | } |
| 152 | |
| 153 | output := err.Error() |
| 154 | if !strings.Contains(output, "invalid syntax") { |
| 155 | t.Errorf("Error should mention invalid syntax, got: %s", output) |
| 156 | } |
| 157 | if !strings.Contains(output, "missing table name") { |
| 158 | t.Errorf("Error should include description, got: %s", output) |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | func TestUnsupportedFeatureError(t *testing.T) { |
| 163 | sql := "SELECT * FROM users WINDOW w AS (PARTITION BY dept)" |
nothing calls this directly
no test coverage detected