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

Function TestRemoveSetClause_RemovesColumn

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

Source from the content-addressed store, hash-verified

60}
61
62func TestRemoveSetClause_RemovesColumn(t *testing.T) {
63 stmt := mustParse(t, "UPDATE users SET name = 'alice', status = 'active', age = 30")
64
65 err := Apply(stmt, RemoveSetClause("status"))
66 if err != nil {
67 t.Fatalf("RemoveSetClause: %v", err)
68 }
69
70 out := format(stmt)
71 assertNotContains(t, out, "status")
72 assertContains(t, out, "name")
73 assertContains(t, out, "age")
74}
75
76func TestRemoveSetClause_NonExistentColumn_NoError(t *testing.T) {
77 stmt := mustParse(t, "UPDATE users SET name = 'alice'")

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected