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

Function TestAddWhere_DirectExpression

pkg/transform/where_test.go:136–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestAddWhere_DirectExpression(t *testing.T) {
137 stmt := mustParse(t, "SELECT * FROM users")
138 cond := &ast.BinaryExpression{
139 Left: &ast.Identifier{Name: "status"},
140 Operator: "=",
141 Right: &ast.LiteralValue{Value: "active", Type: "STRING"},
142 }
143 err := Apply(stmt, AddWhere(cond))
144 if err != nil {
145 t.Fatal(err)
146 }
147 out := format(stmt)
148 assertContains(t, out, "WHERE")
149 assertContains(t, out, "status")
150}

Callers

nothing calls this directly

Calls 5

mustParseFunction · 0.85
ApplyFunction · 0.85
AddWhereFunction · 0.85
assertContainsFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected