MCPcopy
hub / github.com/go-sql-driver/mysql / TestParamsAreSorted

Function TestParamsAreSorted

dsn_test.go:333–346  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

331}
332
333func TestParamsAreSorted(t *testing.T) {
334 expected := "/dbname?interpolateParams=true&foobar=baz&quux=loo"
335 cfg := NewConfig()
336 cfg.DBName = "dbname"
337 cfg.InterpolateParams = true
338 cfg.Params = map[string]string{
339 "quux": "loo",
340 "foobar": "baz",
341 }
342 actual := cfg.FormatDSN()
343 if actual != expected {
344 t.Errorf("generic Config.Params were not sorted: want %#v, got %#v", expected, actual)
345 }
346}
347
348func TestCloneConfig(t *testing.T) {
349 RegisterServerPubKey("testKey", testPubKeyRSA)

Callers

nothing calls this directly

Calls 2

FormatDSNMethod · 0.95
NewConfigFunction · 0.85

Tested by

no test coverage detected