MCPcopy
hub / github.com/sqlc-dev/sqlc / TestReplace

Function TestReplace

internal/shfmt/shfmt_test.go:5–17  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestReplace(t *testing.T) {
6 s := "POSTGRES_SQL://${PG_USER}:${PG_PASSWORD}@${PG_HOST}:${PG_PORT}/AUTHORS"
7 r := NewReplacer([]string{
8 "PG_USER=user",
9 "PG_PASSWORD=password",
10 "PG_HOST=host",
11 "PG_PORT=port",
12 })
13 e := "POSTGRES_SQL://user:password@host:port/AUTHORS"
14 if v := r.Replace(s); v != e {
15 t.Errorf("%s != %s", v, e)
16 }
17}

Callers

nothing calls this directly

Calls 2

ReplaceMethod · 0.95
NewReplacerFunction · 0.85

Tested by

no test coverage detected