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

Function TestSetClause_ReplaceExisting

pkg/transform/set_test.go:49–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestSetClause_ReplaceExisting(t *testing.T) {
50 stmt := mustParse(t, "UPDATE users SET name = 'old', status = 'active'")
51
52 err := Apply(stmt, SetClause("name", "'new'"))
53 if err != nil {
54 t.Fatalf("SetClause: %v", err)
55 }
56
57 out := format(stmt)
58 assertContains(t, out, "new")
59 assertNotContains(t, out, "old")
60}
61
62func TestRemoveSetClause_RemovesColumn(t *testing.T) {
63 stmt := mustParse(t, "UPDATE users SET name = 'alice', status = 'active', age = 30")

Callers

nothing calls this directly

Calls 7

mustParseFunction · 0.85
ApplyFunction · 0.85
assertContainsFunction · 0.85
assertNotContainsFunction · 0.85
SetClauseFunction · 0.70
formatFunction · 0.70
FatalfMethod · 0.65

Tested by

no test coverage detected