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

Function TestReplaceColumn

pkg/transform/columns_test.go:46–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestReplaceColumn(t *testing.T) {
47 stmt := mustParse(t, "SELECT id, name FROM users")
48 err := Apply(stmt, ReplaceColumn("name", "full_name"))
49 if err != nil {
50 t.Fatal(err)
51 }
52 out := format(stmt)
53 assertContains(t, out, "full_name")
54 assertNotContains(t, out, " name")
55}
56
57func TestAddSelectStar(t *testing.T) {
58 stmt := mustParse(t, "SELECT id FROM users")

Callers

nothing calls this directly

Calls 6

mustParseFunction · 0.85
ApplyFunction · 0.85
ReplaceColumnFunction · 0.85
assertContainsFunction · 0.85
assertNotContainsFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected