func TestConfig_PlayMaxWait(t *testing.T) { var tests = []struct { cfg util.ConfigFile expected float64 }{ { util.ConfigFile{}, 0, }, { util.ConfigFile{Play: util.ConfigPlay{MaxWait: 1.23456}}, 1.23456, }, } for _, test := range tests { cfg := util.Config{&test.cfg, nil} actual := cfg.PlayMaxWait() if actual != test.expected { t.Errorf(`expected "%v", got "%v"`, test.expected, actual) } } }