Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL: protocol setter and special URLs #4413

Merged
merged 2 commits into from
Jan 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,30 @@
}
},
{
"comment": "Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104",
"comment": "Can’t switch from special scheme to non-special",
"href": "http://example.net",
"new_value": "b",
"expected": {
"href": "http://example.net/",
"protocol": "http:"
}
},
{
"href": "https://example.net",
"new_value": "s",
"expected": {
"href": "https://example.net/",
"protocol": "https:"
}
},
{
"href": "ftp://example.net",
"new_value": "test",
"expected": {
"href": "ftp://example.net/",
"protocol": "ftp:"
}
},
{
"comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.",
"href": "mailto:me@example.net",
Expand All @@ -120,14 +136,38 @@
}
},
{
"comment": "Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104",
"comment": "Can’t switch from non-special scheme to special",
"href": "ssh://me@example.net",
"new_value": "http",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "gopher",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "ssh://me@example.net",
"new_value": "file",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
}
},
{
"href": "nonsense:///test",
"new_value": "https",
"expected": {
"href": "nonsense:///test",
"protocol": "nonsense:"
}
},
{
"comment": "Stuff after the first ':' is ignored",
"href": "http://example.net",
Expand Down