mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Tests. StringTemplateTest. Fix ambiguity in the method call.
This commit is contained in:
parent
8f1c11ae53
commit
50e06cbaa0
@ -35,7 +35,7 @@ void StringTemplateTest::onRun() {
|
||||
{
|
||||
OATPP_LOGI(TAG, "Case1 ...");
|
||||
StringTemplate t("{} World!", {{0, 1, "p1"}});
|
||||
auto result = t.format({oatpp::String("Hello")});
|
||||
auto result = t.format(std::vector<oatpp::String>({"Hello"}));
|
||||
OATPP_ASSERT(result == "Hello World!");
|
||||
OATPP_LOGI(TAG, "OK");
|
||||
}
|
||||
@ -51,7 +51,7 @@ void StringTemplateTest::onRun() {
|
||||
{
|
||||
OATPP_LOGI(TAG, "Case3 ...");
|
||||
StringTemplate t("Hello {}", {{6, 7, "p1"}});
|
||||
auto result = t.format({oatpp::String("World!")});
|
||||
auto result = t.format(std::vector<oatpp::String>({"World!"}));
|
||||
OATPP_ASSERT(result == "Hello World!");
|
||||
OATPP_LOGI(TAG, "OK");
|
||||
}
|
||||
@ -67,7 +67,7 @@ void StringTemplateTest::onRun() {
|
||||
{
|
||||
OATPP_LOGI(TAG, "Case5 ...");
|
||||
StringTemplate t("Hello {} World!", {{6, 7, "p1"}});
|
||||
auto result = t.format({oatpp::String("My")});
|
||||
auto result = t.format(std::vector<oatpp::String>({"My"}));
|
||||
OATPP_ASSERT(result == "Hello My World!");
|
||||
OATPP_LOGI(TAG, "OK");
|
||||
}
|
||||
@ -83,7 +83,7 @@ void StringTemplateTest::onRun() {
|
||||
{
|
||||
OATPP_LOGI(TAG, "Case7 ...");
|
||||
StringTemplate t("? ? ?", {{0, 0, "p1"}, {2, 2, "p2"}, {4, 4, "p3"}});
|
||||
auto result = t.format({"Hello", "World", "Oat++!"});
|
||||
auto result = t.format(std::vector<oatpp::String>({"Hello", "World", "Oat++!"}));
|
||||
OATPP_ASSERT(result == "Hello World Oat++!");
|
||||
OATPP_LOGI(TAG, "OK");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user