aboutsummaryrefslogtreecommitdiffstats
path: root/unittest.cpp
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-08-02 10:46:00 +0900
committeripknHama <ipknhama@gmail.com>2014-08-02 22:32:49 +0900
commit615e648260a87eb2edabf4aefb456186800e67a1 (patch)
tree7bd8b268a960b2b7d322407160a9d152e32a9251 /unittest.cpp
parent9d1d65b08c4a4c33923935a5414d6e6f4fe59ceb (diff)
downloadcrow-615e648260a87eb2edabf4aefb456186800e67a1.tar.gz
crow-615e648260a87eb2edabf4aefb456186800e67a1.zip
mustache partial implementation
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;