(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestAddSetClause_ReplacesExisting(t *testing.T) { |
| 35 | stmt := mustParse(t, "UPDATE users SET name = 'old', status = 'inactive'") |
| 36 | |
| 37 | err := Apply(stmt, AddSetClause("name", "'new'")) |
| 38 | if err != nil { |
| 39 | t.Fatalf("AddSetClause: %v", err) |
| 40 | } |
| 41 | |
| 42 | out := format(stmt) |
| 43 | assertContains(t, out, "new") |
| 44 | assertNotContains(t, out, "old") |
| 45 | // status should still be present |
| 46 | assertContains(t, out, "status") |
| 47 | } |
| 48 | |
| 49 | func TestSetClause_ReplaceExisting(t *testing.T) { |
| 50 | stmt := mustParse(t, "UPDATE users SET name = 'old', status = 'active'") |
nothing calls this directly
no test coverage detected