2016-12-23 02:28:21 +08:00
|
|
|
#include "gtest/gtest.h"
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
#include "template_engine/engine.hpp"
|
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
TEST(TemplateEngine, BasicPlaceholderReplacement) {
|
2017-04-18 18:11:25 +08:00
|
|
|
auto rendered = template_engine::Render("{{one}} {{two}}",
|
2017-02-18 18:54:37 +08:00
|
|
|
{{"one", "two"}, {"two", "one"}});
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
ASSERT_EQ(rendered, "two one");
|
2016-12-23 02:28:21 +08:00
|
|
|
}
|
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
int main(int argc, char **argv) {
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
return RUN_ALL_TESTS();
|
2016-07-05 11:01:22 +08:00
|
|
|
}
|