MCPcopy Create free account
hub / github.com/google/go-querystring / TestValues_Slices

Function TestValues_Slices

query/encode_test.go:136–273  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestValues_Slices(t *testing.T) {
137 tests := []struct {
138 input interface{}
139 want url.Values
140 }{
141 // slices of strings
142 {
143 struct{ V []string }{},
144 url.Values{},
145 },
146 {
147 struct{ V []string }{[]string{}},
148 url.Values{},
149 },
150 {
151 struct{ V []string }{[]string{""}},
152 url.Values{"V": {""}},
153 },
154 {
155 struct{ V []string }{[]string{"a", "b"}},
156 url.Values{"V": {"a", "b"}},
157 },
158 {
159 struct {
160 V []string `url:",comma"`
161 }{[]string{}},
162 url.Values{},
163 },
164 {
165 struct {
166 V []string `url:",comma"`
167 }{[]string{""}},
168 url.Values{"V": {""}},
169 },
170 {
171 struct {
172 V []string `url:",comma"`
173 }{[]string{"a", "b"}},
174 url.Values{"V": {"a,b"}},
175 },
176 {
177 struct {
178 V []string `url:",space"`
179 }{[]string{"a", "b"}},
180 url.Values{"V": {"a b"}},
181 },
182 {
183 struct {
184 V []string `url:",semicolon"`
185 }{[]string{"a", "b"}},
186 url.Values{"V": {"a;b"}},
187 },
188 {
189 struct {
190 V []string `url:",brackets"`
191 }{[]string{"a", "b"}},
192 url.Values{"V[]": {"a", "b"}},
193 },

Callers

nothing calls this directly

Calls 1

testValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…