summaryrefslogtreecommitdiff
path: root/tests/U_tests.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/U_tests.json')
-rw-r--r--tests/U_tests.json50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/U_tests.json b/tests/U_tests.json
new file mode 100644
index 0000000..bf8d129
--- /dev/null
+++ b/tests/U_tests.json
@@ -0,0 +1,50 @@
+[
+
+ {
+ "args": ["/foo.html", {"bar": {"gna": 42, "qux": {"quux": "<Zürich>", "gnöp": "fasel"}}}],
+ "exp": "/foo.html?bar[gna]=42&bar[qux][quux]=%3CZ%C3%BCrich%3E&bar[qux][gn%C3%B6p]=fasel",
+ "name": "U() with nested arrays"
+ },
+
+ {
+ "args": ["/foo.html?a=b&bar=qux&c=d", {"bar": "baz"}],
+ "exp": "/foo.html?a=b&bar=baz&c=d",
+ "name": "U() args override get params in base url"
+ },
+
+ {
+ "args": ["/foo.html?bar.qux=a.b", {"c.d": "e.f", "g h": "i j"}],
+ "exp": "/foo.html?bar.qux=a.b&c.d=e.f&g+h=i+j",
+ "name": "U() dots and spaces in arg names are preserved"
+ },
+
+ {
+ "args": ["/foo.html?bar=qux#frag=frog", {"baz": "gna"}],
+ "exp": "/foo.html?bar=qux&baz=gna#frag=frog",
+ "name": "U() fragment after params"
+ },
+
+ {
+ "args": ["Jet d'eau"],
+ "exp": "Jet%20d%27eau",
+ "name": "U() with single quotes in URL"
+ },
+
+ {
+ "args": ["/test.html?foo=bar?qux=gna", {"?q": "?r"}],
+ "exp": "/test.html?foo=bar%3Fqux%3Dgna&%3Fq=%3Fr",
+ "name": "U() quoting of ? in args but not base"
+ },
+
+ {
+ "args": ["%% %1%x %1x%x1%xx%11%ff%FF"],
+ "exp": "%25%25%20%251%25x%20%251x%25x1%25xx%11%ff%FF",
+ "name": "U() quoting of % if not followed by 2 hex digits"
+ },
+
+ {
+ "args": ["a\\b"],
+ "exp": "a/b",
+ "name": "U() converting of \\ to /"
+ }
+]