MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestRenderCase_Searched

Function TestRenderCase_Searched

pkg/formatter/render_test.go:871–881  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

869}
870
871func 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
883func TestRenderCase_Nil(t *testing.T) {
884 var expr *ast.CaseExpression

Callers

nothing calls this directly

Calls 3

ReadableStyleFunction · 0.92
fmtExprFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected