MCPcopy Create free account
hub / github.com/aws/smithy-go / TestQueryValue

Function TestQueryValue

encoding/httpbinding/query_test.go:11–203  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestQueryValue(t *testing.T) {
12 const queryKey = "someKey"
13
14 cases := map[string]struct {
15 values url.Values
16 args []interface{}
17 append bool
18 expected url.Values
19 }{
20 "set blob": {
21 values: url.Values{queryKey: []string{"foobar"}},
22 args: []interface{}{[]byte("baz")},
23 expected: map[string][]string{
24 queryKey: {"YmF6"},
25 },
26 },
27 "set bool": {
28 values: url.Values{queryKey: []string{"foobar"}},
29 args: []interface{}{true},
30 expected: map[string][]string{
31 queryKey: {"true"},
32 },
33 },
34 "set string": {
35 values: url.Values{queryKey: []string{"foobar"}},
36 args: []interface{}{"string value"},
37 expected: map[string][]string{
38 queryKey: {"string value"},
39 },
40 },
41 "set byte": {
42 values: url.Values{queryKey: []string{"foobar"}},
43 args: []interface{}{int8(127)},
44 expected: map[string][]string{
45 queryKey: {"127"},
46 },
47 },
48 "set short": {
49 values: url.Values{queryKey: []string{"foobar"}},
50 args: []interface{}{int16(32767)},
51 expected: map[string][]string{
52 queryKey: {"32767"},
53 },
54 },
55 "set integer": {
56 values: url.Values{queryKey: []string{"foobar"}},
57 args: []interface{}{int32(2147483647)},
58 expected: map[string][]string{
59 queryKey: {"2147483647"},
60 },
61 },
62 "set long": {
63 values: url.Values{queryKey: []string{"foobar"}},
64 args: []interface{}{int64(9223372036854775807)},
65 expected: map[string][]string{
66 queryKey: {"9223372036854775807"},
67 },
68 },

Callers

nothing calls this directly

Calls 3

NewQueryValueFunction · 0.85
setQueryValueFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected