MCPcopy
hub / github.com/spf13/viper / TestSubWithKeyDelimiter

Function TestSubWithKeyDelimiter

viper_test.go:1715–1724  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1713}
1714
1715func TestSubWithKeyDelimiter(t *testing.T) {
1716 v := NewWithOptions(KeyDelimiter("::"))
1717 v.SetConfigType("yaml")
1718 r := strings.NewReader(string(yamlExampleWithDot))
1719 err := v.unmarshalReader(r, v.config)
1720 require.NoError(t, err)
1721
1722 subv := v.Sub("emails")
1723 assert.Equal(t, "01/02/03", subv.Get("steve@hacker.com::created"))
1724}
1725
1726var jsonWriteExpected = []byte(`{
1727 "batters": {

Callers

nothing calls this directly

Calls 6

NewWithOptionsFunction · 0.85
KeyDelimiterFunction · 0.85
SetConfigTypeMethod · 0.80
unmarshalReaderMethod · 0.80
SubMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected