-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update web-platform tests for url
PR-URL: #46860 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
- Loading branch information
Showing
6 changed files
with
121 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
test(() => { | ||
const params = new URLSearchParams("a=1&b=2&a=3"); | ||
assert_equals(params.size, 3); | ||
|
||
params.delete("a"); | ||
assert_equals(params.size, 1); | ||
}, "URLSearchParams's size and deletion"); | ||
|
||
test(() => { | ||
const params = new URLSearchParams("a=1&b=2&a=3"); | ||
assert_equals(params.size, 3); | ||
|
||
params.append("b", "4"); | ||
assert_equals(params.size, 4); | ||
}, "URLSearchParams's size and addition"); | ||
|
||
test(() => { | ||
const url = new URL("http://localhost/query?a=1&b=2&a=3"); | ||
assert_equals(url.searchParams.size, 3); | ||
|
||
url.searchParams.delete("a"); | ||
assert_equals(url.searchParams.size, 1); | ||
|
||
url.searchParams.append("b", 4); | ||
assert_equals(url.searchParams.size, 2); | ||
}, "URLSearchParams's size when obtained from a URL"); | ||
|
||
test(() => { | ||
const url = new URL("http://localhost/query?a=1&b=2&a=3"); | ||
assert_equals(url.searchParams.size, 3); | ||
|
||
url.search = "?"; | ||
assert_equals(url.searchParams.size, 0); | ||
}, "URLSearchParams's size when obtained from a URL and using .search"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters