mirror of
https://github.com/spf13/viper
synced 2024-12-23 03:57:01 +00:00
Add breaking test that requires reverting #673
This commit is contained in:
parent
371f39c3ab
commit
398adc5a7d
1 changed files with 19 additions and 2 deletions
|
@ -1856,6 +1856,23 @@ func TestWatchFile(t *testing.T) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUnmarshal_DotSeparatorBackwardCompatibility(t *testing.T) {
|
||||||
|
flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
|
||||||
|
flags.String("foo.bar", "cobra_flag", "")
|
||||||
|
|
||||||
|
v := New()
|
||||||
|
assert.NoError(t, v.BindPFlags(flags))
|
||||||
|
|
||||||
|
config := &struct {
|
||||||
|
Foo struct {
|
||||||
|
Bar string
|
||||||
|
}
|
||||||
|
}{}
|
||||||
|
|
||||||
|
assert.NoError(t, v.Unmarshal(config))
|
||||||
|
assert.Equal(t, "cobra_flag", config.Foo.Bar)
|
||||||
|
}
|
||||||
|
|
||||||
func BenchmarkGetBool(b *testing.B) {
|
func BenchmarkGetBool(b *testing.B) {
|
||||||
key := "BenchmarkGetBool"
|
key := "BenchmarkGetBool"
|
||||||
v = New()
|
v = New()
|
||||||
|
|
Loading…
Reference in a new issue