mirror of
https://github.com/golang/go
synced 2024-11-20 10:44:41 -07:00
http: fix build
R=dsymonds TBR=dsymonds CC=golang-dev https://golang.org/cl/3425044
This commit is contained in:
parent
cab83650d1
commit
8694959b12
@ -513,17 +513,18 @@ type qMap map[string][]string
|
||||
type EncodeQueryTest struct {
|
||||
m qMap
|
||||
expected string
|
||||
expected1 string
|
||||
}
|
||||
|
||||
var encodeQueryTests = []EncodeQueryTest{
|
||||
{nil, ""},
|
||||
{qMap{"q": {"puppies"}, "oe": {"utf8"}}, "q=puppies&oe=utf8"},
|
||||
{qMap{"q": {"dogs", "&", "7"}}, "q=dogs&q=%26&q=7"},
|
||||
{nil, "", ""},
|
||||
{qMap{"q": {"puppies"}, "oe": {"utf8"}}, "q=puppies&oe=utf8", "oe=utf8&q=puppies"},
|
||||
{qMap{"q": {"dogs", "&", "7"}}, "q=dogs&q=%26&q=7", "q=dogs&q=%26&q=7"},
|
||||
}
|
||||
|
||||
func TestEncodeQuery(t *testing.T) {
|
||||
for _, tt := range encodeQueryTests {
|
||||
if q := EncodeQuery(tt.m); q != tt.expected {
|
||||
if q := EncodeQuery(tt.m); q != tt.expected && q != tt.expected1 {
|
||||
t.Errorf(`EncodeQuery(%+v) = %q, want %q`, tt.m, q, tt.expected)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user