Skip to content

Commit

Permalink
Test IPv4 part of IPv6
Browse files Browse the repository at this point in the history
See whatwg/url#195 for context.
  • Loading branch information
annevk authored Jan 11, 2017
1 parent 1b2baa1 commit 9035d5e
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 5 deletions.
92 changes: 92 additions & 0 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,52 @@
"hostname": "example.com",
"port": ""
}
},
{
"comment": "Broken IPv6",
"href": "http://example.net/",
"new_value": "[google.com]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.3.4x]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.3.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
}
],
"hostname": [
Expand Down Expand Up @@ -787,6 +833,52 @@
"hostname": "example.net",
"port": ""
}
},
{
"comment": "Broken IPv6",
"href": "http://example.net/",
"new_value": "[google.com]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.3.4x]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.3.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.2.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
},
{
"href": "http://example.net/",
"new_value": "[::1.]",
"expected": {
"href": "http://example.net/",
"host": "example.net",
"hostname": "example.net"
}
}
],
"port": [
Expand Down
30 changes: 25 additions & 5 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2248,11 +2248,6 @@
"search": "",
"hash": "# %C2%BB"
},
{
"input": "http://[www.google.com]/",
"base": "about:blank",
"failure": true
},
{
"input": "http://www.google.com",
"base": "about:blank",
Expand Down Expand Up @@ -3689,11 +3684,36 @@
"hash": ""
},
"Broken IPv6",
{
"input": "http://[www.google.com]/",
"base": "about:blank",
"failure": true
},
{
"input": "http://[google.com]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.3.4x]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.3.]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.]",
"base": "http://other.com/",
"failure": true
},
"Misc Unicode",
{
"input": "http://foo:💩@example.com/bar",
Expand Down

0 comments on commit 9035d5e

Please sign in to comment.