(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func 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 | } |
nothing calls this directly
no test coverage detected