diff options
Diffstat (limited to 'unittest.cpp')
-rw-r--r-- | unittest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unittest.cpp b/unittest.cpp index 718d3d2..680bf50 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -6,6 +6,7 @@ #include "utility.h" #include "crow.h" #include "json.h" +#include "mustache.h" using namespace std; using namespace crow; @@ -380,6 +381,16 @@ TEST(json_write) ASSERT_EQUAL(R"({"scores":{"a":{"b":{"c":null}}}})", json::dump(y)); } +TEST(template_basic) +{ + auto t = crow::mustache::compile(R"---(attack of {{name}})---"); + crow::mustache::context ctx; + ctx["name"] = "killer tomatoes"; + auto result = t.render(ctx); + ASSERT_EQUAL("attack of killer tomatoes", result); + //crow::mustache::load("basic.mustache"); +} + int testmain() { bool failed = false; |