aboutsummaryrefslogtreecommitdiffstats
path: root/unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittest.cpp')
-rw-r--r--unittest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/unittest.cpp b/unittest.cpp
index 07bf2bf..eec119e 100644
--- a/unittest.cpp
+++ b/unittest.cpp
@@ -414,6 +414,18 @@ TEST(template_basic)
//crow::mustache::load("basic.mustache");
}
+TEST(template_load)
+{
+ crow::mustache::set_base(".");
+ ofstream("test.mustache") << R"---(attack of {{name}})---";
+ auto t = crow::mustache::load("test.mustache");
+ crow::mustache::context ctx;
+ ctx["name"] = "killer tomatoes";
+ auto result = t.render(ctx);
+ ASSERT_EQUAL("attack of killer tomatoes", result);
+ unlink("test.mustache");
+}
+
int testmain()
{
bool failed = false;