]> Cypherpunks repositories - gostls13.git/commitdiff
http: fix build
authorRuss Cox <rsc@golang.org>
Tue, 7 Dec 2010 21:20:15 +0000 (16:20 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 7 Dec 2010 21:20:15 +0000 (16:20 -0500)
R=dsymonds
TBR=dsymonds
CC=golang-dev
https://golang.org/cl/3425044

src/pkg/http/url_test.go

index 59b4750aa40cdde61471af149604687e469b73bb..447d5390ef6500a22833c95e39a5e2bf7ce476dc 100644 (file)
@@ -511,19 +511,20 @@ func TestUnescapeUserinfo(t *testing.T) {
 type qMap map[string][]string
 
 type EncodeQueryTest struct {
-       m        qMap
-       expected string
+       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)
                }
        }