mirror of
https://github.com/spf13/viper.git
synced 2024-04-21 12:31:38 +00:00
ci: enable test shuffle; fix tests
This commit is contained in:
committed by
Márk Sági-Kazár
parent
73dfb94c57
commit
3a23b80b11
@@ -471,6 +471,7 @@ func TestReadInConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDefault(t *testing.T) {
|
||||
Reset()
|
||||
SetDefault("age", 45)
|
||||
assert.Equal(t, 45, Get("age"))
|
||||
|
||||
@@ -485,6 +486,7 @@ func TestDefault(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUnmarshaling(t *testing.T) {
|
||||
Reset()
|
||||
SetConfigType("yaml")
|
||||
r := bytes.NewReader(yamlExample)
|
||||
|
||||
@@ -521,6 +523,8 @@ func TestDefaultPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAliases(t *testing.T) {
|
||||
initConfigs()
|
||||
Set("age", 40)
|
||||
RegisterAlias("years", "age")
|
||||
assert.Equal(t, 40, Get("years"))
|
||||
Set("years", 45)
|
||||
@@ -528,6 +532,7 @@ func TestAliases(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAliasInConfigFile(t *testing.T) {
|
||||
initConfigs()
|
||||
// the config file specifies "beard". If we make this an alias for
|
||||
// "hasbeard", we still want the old config file to work with beard.
|
||||
RegisterAlias("beard", "hasbeard")
|
||||
@@ -870,6 +875,7 @@ func TestRecursiveAliases(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUnmarshal(t *testing.T) {
|
||||
Reset()
|
||||
SetDefault("port", 1313)
|
||||
Set("name", "Steve")
|
||||
Set("duration", "1s1ms")
|
||||
@@ -1341,6 +1347,7 @@ func TestBindPFlagStringToInt(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBoundCaseSensitivity(t *testing.T) {
|
||||
initConfigs()
|
||||
assert.Equal(t, "brown", Get("eyes"))
|
||||
|
||||
BindEnv("eYEs", "TURTLE_EYES")
|
||||
|
||||
Reference in New Issue
Block a user