(t *testing.T)
| 869 | } |
| 870 | |
| 871 | func TestRenderCase_Searched(t *testing.T) { |
| 872 | expr := &ast.CaseExpression{ |
| 873 | WhenClauses: []ast.WhenClause{ |
| 874 | {Condition: &ast.BinaryExpression{Left: &ast.Identifier{Name: "x"}, Operator: ">", Right: &ast.LiteralValue{Value: "0"}}, Result: &ast.LiteralValue{Value: "'pos'"}}, |
| 875 | }, |
| 876 | } |
| 877 | result := fmtExpr(expr, ast.ReadableStyle()) |
| 878 | if !strings.Contains(result, "CASE WHEN") { |
| 879 | t.Errorf("expected searched CASE in: %s", result) |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | func TestRenderCase_Nil(t *testing.T) { |
| 884 | var expr *ast.CaseExpression |
nothing calls this directly
no test coverage detected