mirror of
https://github.com/spf13/viper
synced 2025-05-11 22:57:21 +00:00
added testcase for #1019
This commit is contained in:
parent
a802f4d425
commit
8faa480176
1 changed files with 2 additions and 0 deletions
|
@ -494,6 +494,7 @@ func TestEnv(t *testing.T) {
|
||||||
testutil.Setenv(t, "FOOD", "apple")
|
testutil.Setenv(t, "FOOD", "apple")
|
||||||
testutil.Setenv(t, "OLD_FOOD", "banana")
|
testutil.Setenv(t, "OLD_FOOD", "banana")
|
||||||
testutil.Setenv(t, "NAME", "crunk")
|
testutil.Setenv(t, "NAME", "crunk")
|
||||||
|
testutil.Setenv(t, "NEW_FOOD", "pear")
|
||||||
|
|
||||||
assert.Equal(t, "13", Get("id"))
|
assert.Equal(t, "13", Get("id"))
|
||||||
assert.Equal(t, "apple", Get("f"))
|
assert.Equal(t, "apple", Get("f"))
|
||||||
|
@ -501,6 +502,7 @@ func TestEnv(t *testing.T) {
|
||||||
|
|
||||||
AutomaticEnv()
|
AutomaticEnv()
|
||||||
|
|
||||||
|
assert.Equal(t, "pear", Get("new-food"))
|
||||||
assert.Equal(t, "crunk", Get("name"))
|
assert.Equal(t, "crunk", Get("name"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue