MCPcopy
hub / github.com/gourouting/singo / TestDatabaseDSNAllowsAtSignInUser

Function TestDatabaseDSNAllowsAtSignInUser

conf/conf_test.go:165–180  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestDatabaseDSNAllowsAtSignInUser(t *testing.T) {
166 setDBEnv(t, map[string]string{
167 "DB_USER": "app@server",
168 "DB_NAME": "singo",
169 })
170
171 dsn, err := DatabaseDSN()
172 if err != nil {
173 t.Fatalf("expected no error, got %v", err)
174 }
175
176 config := parseConfig(t, dsn)
177 if config.User != "app@server" {
178 t.Fatalf("expected user to round-trip, got %q", config.User)
179 }
180}
181
182func TestDatabaseDSNRejectsReservedCharacters(t *testing.T) {
183 tests := []struct {

Callers

nothing calls this directly

Calls 3

setDBEnvFunction · 0.85
DatabaseDSNFunction · 0.85
parseConfigFunction · 0.85

Tested by

no test coverage detected