Tests: add a test for shadowed nested key

"clothing.jacket.price" exists in defaults map, but "clothing.jacket" exists
and is a value in config map
=> should remain undefined (“shadowed” by the config)
This commit is contained in:
Benoit Masson 2016-09-27 15:09:09 +02:00
parent 63a39fe605
commit 17581d7cab

View file

@ -918,8 +918,10 @@ func TestShadowedNestedValue(t *testing.T) {
polyester := "polyester"
initYAML()
SetDefault("clothing.shirt", polyester)
SetDefault("clothing.jacket.price", 100)
assert.Equal(t, "leather", GetString("clothing.jacket"))
assert.Nil(t, Get("clothing.jacket.price"))
assert.Equal(t, polyester, GetString("clothing.shirt"))
}