|
|
@@ -88,25 +88,3 @@ func TestDomain(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-func TestRequestURI(t *testing.T) {
|
|
|
- scenarios := map[string]string{
|
|
|
- "https://www.example.org": "https://www.example.org",
|
|
|
- "https://user:password@www.example.org": "https://user:password@www.example.org",
|
|
|
- "https://www.example.org/path with spaces": "https://www.example.org/path%20with%20spaces",
|
|
|
- "https://www.example.org/path#test": "https://www.example.org/path",
|
|
|
- "https://www.example.org/path?abc#test": "https://www.example.org/path?abc",
|
|
|
- "https://www.example.org/path?a=b&a=c": "https://www.example.org/path?a=b&a=c",
|
|
|
- "https://www.example.org/path?a=b&a=c&d": "https://www.example.org/path?a=b&a=c&d",
|
|
|
- "https://www.example.org/path?atom": "https://www.example.org/path?atom",
|
|
|
- "https://www.example.org/path?测试=测试": "https://www.example.org/path?%E6%B5%8B%E8%AF%95=%E6%B5%8B%E8%AF%95",
|
|
|
- "https://www.example.org/url=http%3A%2F%2Fwww.example.com%2Ffeed%2F&max=20": "https://www.example.org/url=http%3A%2F%2Fwww.example.com%2Ffeed%2F&max=20",
|
|
|
- }
|
|
|
-
|
|
|
- for input, expected := range scenarios {
|
|
|
- actual := RequestURI(input)
|
|
|
- if actual != expected {
|
|
|
- t.Errorf(`Unexpected result, got %q instead of %q`, actual, expected)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|