[core] don't use <sstream> and <iomanip> for string construction

This commit is contained in:
Konstantin Käfer
2018-10-17 16:28:31 +02:00
parent 2766e64973
commit c87c25cc84
4 changed files with 43 additions and 30 deletions

View File

@@ -6,6 +6,14 @@
using namespace mbgl::util;
TEST(URL, percentEncode) {
EXPECT_EQ("%22%C3%A9nc%C3%B8%C3%B0ing%22", percentEncode("\"éncøðing\""));
}
TEST(URL, percentDecode) {
EXPECT_EQ("\"éncøðing\"", percentDecode("%22%C3%A9nc%C3%B8%C3%B0ing%22"));
}
TEST(URL, Scheme) {
EXPECT_EQ(URL::Segment({ 0, 4 }), URL("http://example.com/test?query=foo").scheme);
EXPECT_EQ(URL::Segment({ 0, 4 }), URL("http://127.0.0.1:8080/test?query=foo").scheme);