MCPcopy Create free account
hub / github.com/stretchr/objx / TestConversionURLQuery

Function TestConversionURLQuery

conversions_test.go:116–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestConversionURLQuery(t *testing.T) {
117 m := getURLQueryMap()
118 u, err := m.URLQuery()
119
120 assert.Nil(t, err)
121 require.NotNil(t, u)
122
123 ue, err := url.QueryUnescape(u)
124 assert.Nil(t, err)
125 require.NotNil(t, ue)
126
127 assert.Equal(t, "abc=123&bools[]=true&bools[]=false&data[age]=30&data[arr][]=1&data[arr][]=2&data[height]=162&mapSlice[][age]=40&mapSlice[][height]=152&msiData[age]=30&msiData[arr][]=1&msiData[arr][]=2&msiData[height]=162&msiSlice[][age]=40&msiSlice[][height]=152&name=Mat&stats[]=1&stats[]=2", ue)
128}
129
130func TestConversionURLQueryNoSliceKeySuffix(t *testing.T) {
131 m := getURLQueryMap()

Callers

nothing calls this directly

Calls 5

getURLQueryMapFunction · 0.85
URLQueryMethod · 0.80
NilMethod · 0.45
NotNilMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…