1
0
mirror of synced 2025-04-21 22:25:55 +03:00

Added encode_uri_param tests with UTF-8 characters (#818)

Remove additional lines between tests
This commit is contained in:
Yuri Santos 2020-12-31 01:06:36 -03:00 committed by GitHub
parent 2c07ec4600
commit 86f637a246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,21 @@ TEST(EncodeQueryParamTest, ParseReservedCharactersTest) {
"%3B%2C%2F%3F%3A%40%26%3D%2B%24");
}
TEST(EncodeQueryParamTest, TestUTF8Characters){
string chineseCharacters = "中国語";
string russianCharacters = "дом";
string brazilianCharacters = "óculos";
EXPECT_EQ(detail::encode_query_param(chineseCharacters),
"%E4%B8%AD%E5%9B%BD%E8%AA%9E");
EXPECT_EQ(detail::encode_query_param(russianCharacters),
"%D0%B4%D0%BE%D0%BC");
EXPECT_EQ(detail::encode_query_param(brazilianCharacters),
"%C3%B3culos");
}
TEST(TrimTests, TrimStringTests) {
EXPECT_EQ("abc", detail::trim_copy("abc"));
EXPECT_EQ("abc", detail::trim_copy(" abc "));