Skip to content

Commit e2b2bd2

Browse files
committed
test: add more tests for to_string serialization
1 parent fecba80 commit e2b2bd2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/url_search_params.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ TEST(url_search_params, to_string) {
2222
}
2323

2424
/**
25-
* @see https://github.com/web-platform-tests/wpt/blob/master/url/urlsearchparams-stringifier.any.js
25+
* @see
26+
* https://github.com/web-platform-tests/wpt/blob/master/url/urlsearchparams-stringifier.any.js
2627
*/
2728
TEST(url_search_params, to_string_serialize_space) {
2829
auto params = ada::url_search_params();
@@ -52,6 +53,15 @@ TEST(url_search_params, to_string_serialize_plus) {
5253
SUCCEED();
5354
}
5455

56+
TEST(url_search_params, to_string_serialize_ampersand) {
57+
auto params = ada::url_search_params();
58+
params.append("&", "a");
59+
ASSERT_EQ(params.to_string(), "%26=a");
60+
params.remove("&");
61+
ASSERT_EQ(params.to_string(), "%26=a&b=%26");
62+
SUCCEED();
63+
}
64+
5565
TEST(url_search_params, set) {
5666
auto search_params = ada::url_search_params();
5767
search_params.append("key1", "value1");

0 commit comments

Comments
 (0)