mirror of
https://github.com/spf13/viper
synced 2024-11-16 10:07:00 +00:00
Adding some test cases for deep aliases.
This commit is contained in:
parent
df68c0ac38
commit
0b15bed35b
1 changed files with 10 additions and 0 deletions
|
@ -218,3 +218,13 @@ func TestDeepAutomaticEnv(t *testing.T) {
|
||||||
os.Setenv("CLOTHING__JACKET", "jean")
|
os.Setenv("CLOTHING__JACKET", "jean")
|
||||||
assert.Equal(t, "jean", Get("clothing.jacket"))
|
assert.Equal(t, "jean", Get("clothing.jacket"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDeepAlias(t *testing.T) {
|
||||||
|
RegisterAlias("jacket", "clothing.jacket")
|
||||||
|
assert.Equal(t, "jean", Get("jacket"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDeepAliasCase(t *testing.T) {
|
||||||
|
RegisterAlias("jacket", "clothing.Jacket")
|
||||||
|
assert.Equal(t, "jean", Get("jacket"))
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue