MCPcopy Create free account
hub / github.com/go-pg/pg / TestOptions_ToURL_reparsable

Function TestOptions_ToURL_reparsable

options_test.go:293–316  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

291}
292
293func TestOptions_ToURL_reparsable(t *testing.T) {
294 assert := assert.New(t)
295
296 opts := &Options{
297 Database: "postgres",
298 User: "postgres",
299 Password: "password",
300 Addr: "somewhere:1234",
301 ApplicationName: "test",
302 DialTimeout: time.Second,
303 }
304
305 url := opts.ToURL()
306
307 actual, err := ParseURL(url)
308 assert.NoError(err)
309
310 assert.Equal(opts.Database, actual.Database)
311 assert.Equal(opts.User, actual.User)
312 assert.Equal(opts.Password, actual.Password)
313 assert.Equal(opts.Addr, actual.Addr)
314 assert.Equal(opts.ApplicationName, actual.ApplicationName)
315 assert.Equal(opts.DialTimeout, actual.DialTimeout)
316}

Callers

nothing calls this directly

Calls 3

ToURLMethod · 0.95
ParseURLFunction · 0.85
NewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…