Skip to content

Commit

Permalink
url: update searchParams tests to expect encoded results
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Jan 19, 2024
1 parent 2487726 commit b0270bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions test/fixtures/wpt/url/url-searchparams.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ function runURLSearchParamTests() {
assert_equals(searchParams.get('e'), 'updated')

var url2 = bURL('http://example.org/file??a=b&c=d')
assert_equals(url2.search, '??a=b&c=d')
assert_equals(url2.searchParams.toString(), '%3Fa=b&c=d')
var searchParams2 = url2.searchParams
assert_equals(url2.search, '?%3Fa=b&c=d')
assert_equals(searchParams2.toString(), '%3Fa=b&c=d')

url2.href = 'http://example.org/file??a=b'
assert_equals(url2.search, '??a=b')
assert_equals(url2.searchParams.toString(), '%3Fa=b')
assert_equals(url2.search, '?%3Fa=b')
assert_equals(searchParams2.toString(), '%3Fa=b')
}, 'URL.searchParams and URL.search setters, update propagation')
}
runURLSearchParamTests()
2 changes: 1 addition & 1 deletion test/fixtures/wpt/url/urlsearchparams-stringifier.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ test(() => {
const url = new URL('http://www.example.com/?a=b,c');
const params = url.searchParams;

assert_equals(url.toString(), 'http://www.example.com/?a=b,c');
assert_equals(url.toString(), 'http://www.example.com/?a=b%2Cc');
assert_equals(params.toString(), 'a=b%2Cc');

params.append('x', 'y');
Expand Down

0 comments on commit b0270bc

Please sign in to comment.