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

Function TestTOML

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

Source from the content-addressed store, hash-verified

565}
566
567func TestTOML(t *testing.T) {
568 v := New()
569 v.SetConfigType("toml")
570
571 // Read the TOML data into Viper configuration
572 require.NoError(t, v.ReadConfig(bytes.NewBuffer(tomlExample)), "Error reading toml data")
573
574 assert.Equal(t, "TOML Example", v.Get("title"))
575}
576
577func TestDotEnv(t *testing.T) {
578 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetConfigTypeMethod · 0.80
ReadConfigMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected