(t *testing.T)
| 530 | } |
| 531 | |
| 532 | func TestAliasInConfigFile(t *testing.T) { |
| 533 | v := New() |
| 534 | |
| 535 | v.SetConfigType("yaml") |
| 536 | |
| 537 | // Read the YAML data into Viper configuration |
| 538 | require.NoError(t, v.ReadConfig(bytes.NewBuffer(yamlExample)), "Error reading YAML data") |
| 539 | |
| 540 | v.RegisterAlias("beard", "hasbeard") |
| 541 | assert.Equal(t, true, v.Get("hasbeard")) |
| 542 | |
| 543 | v.Set("hasbeard", false) |
| 544 | assert.Equal(t, false, v.Get("beard")) |
| 545 | } |
| 546 | |
| 547 | func TestYML(t *testing.T) { |
| 548 | v := New() |
nothing calls this directly
no test coverage detected