MCPcopy
hub / github.com/knadh/koanf / TestIssue90

Function TestIssue90

tests/posflag_test.go:64–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestIssue90(t *testing.T) {
65 exampleKeys := map[string]any{
66 "key.one_example": "a struct value",
67 "key.two_example": "b struct value",
68 }
69
70 fs := &pflag.FlagSet{}
71 fs.String("key.one-example", "a posflag value", "")
72 fs.String("key.two_example", "a posflag value", "")
73
74 k := koanf.New(".")
75
76 err := k.Load(confmap.Provider(exampleKeys, "."), nil)
77 require.Nil(t, err)
78
79 err = k.Load(posflag.ProviderWithValue(fs, ".", k, posflagCallback), nil)
80 require.Nil(t, err)
81
82 require.Equal(t, exampleKeys, k.All())
83}
84
85func TestIssue100(t *testing.T) {
86 var err error

Callers

nothing calls this directly

Calls 3

StringMethod · 0.80
LoadMethod · 0.80
AllMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…