Commit 8694959b authored by Russ Cox's avatar Russ Cox

http: fix build

R=dsymonds
TBR=dsymonds
CC=golang-dev
https://golang.org/cl/3425044
parent cab83650
...@@ -511,19 +511,20 @@ func TestUnescapeUserinfo(t *testing.T) { ...@@ -511,19 +511,20 @@ func TestUnescapeUserinfo(t *testing.T) {
type qMap map[string][]string type qMap map[string][]string
type EncodeQueryTest struct { type EncodeQueryTest struct {
m qMap m qMap
expected string expected string
expected1 string
} }
var encodeQueryTests = []EncodeQueryTest{ var encodeQueryTests = []EncodeQueryTest{
{nil, ""}, {nil, "", ""},
{qMap{"q": {"puppies"}, "oe": {"utf8"}}, "q=puppies&oe=utf8"}, {qMap{"q": {"puppies"}, "oe": {"utf8"}}, "q=puppies&oe=utf8", "oe=utf8&q=puppies"},
{qMap{"q": {"dogs", "&", "7"}}, "q=dogs&q=%26&q=7"}, {qMap{"q": {"dogs", "&", "7"}}, "q=dogs&q=%26&q=7", "q=dogs&q=%26&q=7"},
} }
func TestEncodeQuery(t *testing.T) { func TestEncodeQuery(t *testing.T) {
for _, tt := range encodeQueryTests { 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) t.Errorf(`EncodeQuery(%+v) = %q, want %q`, tt.m, q, tt.expected)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment