(t *testing.T)
| 2222 | } |
| 2223 | |
| 2224 | func TestDotParameter(t *testing.T) { |
| 2225 | v := New() |
| 2226 | |
| 2227 | v.SetConfigType("json") |
| 2228 | |
| 2229 | // Read the YAML data into Viper configuration |
| 2230 | require.NoError(t, v.ReadConfig(bytes.NewBuffer(jsonExample)), "Error reading YAML data") |
| 2231 | |
| 2232 | // should take precedence over batters defined in jsonExample |
| 2233 | r := bytes.NewReader([]byte(`{ "batters.batter": [ { "type": "Small" } ] }`)) |
| 2234 | v.unmarshalReader(r, v.config) |
| 2235 | |
| 2236 | actual := v.Get("batters.batter") |
| 2237 | expected := []any{map[string]any{"type": "Small"}} |
| 2238 | assert.Equal(t, expected, actual) |
| 2239 | } |
| 2240 | |
| 2241 | func TestCaseInsensitive(t *testing.T) { |
| 2242 | for _, config := range []struct { |
nothing calls this directly
no test coverage detected