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

Function TestAliases

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

Source from the content-addressed store, hash-verified

521}
522
523func TestAliases(t *testing.T) {
524 v := New()
525 v.Set("age", 40)
526 v.RegisterAlias("years", "age")
527 assert.Equal(t, 40, v.Get("years"))
528 v.Set("years", 45)
529 assert.Equal(t, 45, v.Get("age"))
530}
531
532func TestAliasInConfigFile(t *testing.T) {
533 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
RegisterAliasMethod · 0.80
GetMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected