| 93 | } |
| 94 | |
| 95 | func TestRenderSelect_LowercaseKeywords(t *testing.T) { |
| 96 | stmt := &ast.SelectStatement{ |
| 97 | Columns: []ast.Expression{&ast.Identifier{Name: "id"}}, |
| 98 | From: []ast.TableReference{{Name: "t"}}, |
| 99 | } |
| 100 | |
| 101 | opts := ast.FormatOptions{KeywordCase: ast.KeywordLower, NewlinePerClause: false} |
| 102 | result := fmtStmt(stmt, opts) |
| 103 | if !strings.Contains(result, "select") { |
| 104 | t.Errorf("should contain lowercase select, got: %s", result) |
| 105 | } |
| 106 | if !strings.Contains(result, "from") { |
| 107 | t.Errorf("should contain lowercase from, got: %s", result) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func TestRenderSelect_Distinct(t *testing.T) { |
| 112 | stmt := &ast.SelectStatement{ |