MCPcopy Create free account
hub / github.com/go-openapi/jsonpointer / TestWithNameProvider_setRoutesThroughProvider

Function TestWithNameProvider_setRoutesThroughProvider

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

Source from the content-addressed store, hash-verified

71}
72
73func TestWithNameProvider_setRoutesThroughProvider(t *testing.T) {
74 t.Parallel()
75
76 stub := &stubNameProvider{mapping: map[string]string{"renamed": "Field"}}
77
78 doc := &optionStruct{Field: "before"}
79 p, err := New("/renamed")
80 require.NoError(t, err)
81
82 _, err = p.Set(doc, "after", WithNameProvider(stub))
83 require.NoError(t, err)
84 assert.Equal(t, "after", doc.Field)
85}
86
87func TestSetDefaultNameProvider_roundTrip(t *testing.T) {
88 // Not Parallel: mutates package state.

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
WithNameProviderFunction · 0.85
SetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…