Skip to content

Commit

Permalink
URL: add tests for the distinct percent-encode sets
Browse files Browse the repository at this point in the history
  • Loading branch information
alwinb authored Feb 24, 2021
1 parent e062bd6 commit 33f2e3f
Showing 1 changed file with 180 additions and 0 deletions.
180 changes: 180 additions & 0 deletions url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7429,5 +7429,185 @@
"protocol": "https:",
"search": "",
"username": "user"
},
"Tests for the distinct percent-encode sets",
{
"input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
"origin": "null",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~"
},
{
"input": "wss:// !\"$%&'()*+,-.;<=>@[]^_`{|}~@host/",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/",
"origin": "wss://host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~"
},
{
"input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
"origin": "null",
"password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": "joe"
},
{
"input": "wss://joe: !\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/",
"origin": "wss://host",
"password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": "joe"
},
{ "input": "foo://!\"$%&'()*+,-.;=_`{}~/",
"base": "about:blank",
"hash": "",
"host": "!\"$%&'()*+,-.;=_`{}~",
"hostname": "!\"$%&'()*+,-.;=_`{}~",
"href":"foo://!\"$%&'()*+,-.;=_`{}~/",
"origin": "null",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "wss://!\"$&'()*+,-.;=_`{}~/",
"base": "about:blank",
"hash": "",
"host": "!\"$&'()*+,-.;=_`{}~",
"hostname": "!\"$&'()*+,-.;=_`{}~",
"href":"wss://!\"$&'()*+,-.;=_`{}~/",
"origin": "wss://!\"$&'()*+,-.;=_`{}~",
"password": "",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
},
{
"input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"origin": "null",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "wss://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
"origin": "wss://host",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
},
{
"input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "foo:",
"search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": "about:blank",
"hash": "",
"host": "host",
"hostname": "host",
"href": "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"origin": "wss://host",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "wss:",
"search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": "about:blank",
"hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"host": "host",
"hostname": "host",
"href": "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "wss://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": "about:blank",
"hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"host": "host",
"hostname": "host",
"href": "wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"origin": "wss://host",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
}
]

0 comments on commit 33f2e3f

Please sign in to comment.