(t *testing.T)
| 962 | } |
| 963 | |
| 964 | func TestRenderIn_Subquery(t *testing.T) { |
| 965 | expr := &ast.InExpression{ |
| 966 | Expr: &ast.Identifier{Name: "id"}, |
| 967 | Subquery: &ast.SelectStatement{ |
| 968 | Columns: []ast.Expression{&ast.Identifier{Name: "id"}}, |
| 969 | From: []ast.TableReference{{Name: "other"}}, |
| 970 | }, |
| 971 | } |
| 972 | result := fmtExpr(expr, ast.ReadableStyle()) |
| 973 | if !strings.Contains(result, "IN (") || !strings.Contains(result, "SELECT") { |
| 974 | t.Errorf("expected IN (SELECT ...) in: %s", result) |
| 975 | } |
| 976 | } |
| 977 | |
| 978 | func TestRenderIn_Nil(t *testing.T) { |
| 979 | var expr *ast.InExpression |
nothing calls this directly
no test coverage detected