MCPcopy Index your code
hub / github.com/go-openapi/jsonpointer / TestDefaultNameProvider_reachesGetForToken

Function TestDefaultNameProvider_reachesGetForToken

options_test.go:137–149  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

135}
136
137func TestDefaultNameProvider_reachesGetForToken(t *testing.T) {
138 // Not Parallel: mutates package state.
139 original := DefaultNameProvider()
140 t.Cleanup(func() { SetDefaultNameProvider(original) })
141
142 stub := &stubNameProvider{mapping: map[string]string{"renamed": "Field"}}
143 SetDefaultNameProvider(stub)
144
145 doc := optionStruct{Field: "hello"}
146 v, _, err := GetForToken(doc, "renamed")
147 require.NoError(t, err)
148 assert.Equal(t, "hello", v)
149}

Callers

nothing calls this directly

Calls 3

DefaultNameProviderFunction · 0.85
SetDefaultNameProviderFunction · 0.85
GetForTokenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…