Skip to content

Commit

Permalink
update existing setter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jan 5, 2017
1 parent d7bb941 commit 7d81096
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,78 +27,87 @@
"href": "a://example.net",
"new_value": "",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
"href": "a://example.net",
"new_value": "b",
"expected": {
"href": "b://example.net/",
"protocol": "b:"
"href": "b://example.net",
"protocol": "b:",
"pathname": ""
}
},
{
"comment": "Upper-case ASCII is lower-cased",
"href": "a://example.net",
"new_value": "B",
"expected": {
"href": "b://example.net/",
"protocol": "b:"
"href": "b://example.net",
"protocol": "b:",
"pathname": ""
}
},
{
"comment": "Non-ASCII is rejected",
"href": "a://example.net",
"new_value": "é",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
"comment": "No leading digit",
"href": "a://example.net",
"new_value": "0b",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
"comment": "No leading punctuation",
"href": "a://example.net",
"new_value": "+b",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
"href": "a://example.net",
"new_value": "bC0+-.",
"expected": {
"href": "bc0+-.://example.net/",
"protocol": "bc0+-.:"
"href": "bc0+-.://example.net",
"protocol": "bc0+-.:",
"pathname": ""
}
},
{
"comment": "Only some punctuation is acceptable",
"href": "a://example.net",
"new_value": "b,c",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
"comment": "Non-ASCII is rejected",
"href": "a://example.net",
"new_value": "",
"expected": {
"href": "a://example.net/",
"protocol": "a:"
"href": "a://example.net",
"protocol": "a:",
"pathname": ""
}
},
{
Expand Down Expand Up @@ -140,8 +149,9 @@
"href": "ssh://me@example.net",
"new_value": "http",
"expected": {
"href": "ssh://me@example.net/",
"protocol": "ssh:"
"href": "ssh://me@example.net",
"protocol": "ssh:",
"pathname": ""
}
},
{
Expand Down

0 comments on commit 7d81096

Please sign in to comment.