From 8d76becf1cd898d61016458d6d2a25592c09beda Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:01:22 +0800 Subject: [PATCH] feat add inja test --- CMakeLists.txt | 1 + src/sled/nonstd/inja_test.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/sled/nonstd/inja_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index eaa15ad..6bed65b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,7 @@ if(SLED_BUILD_TESTS) sled_add_test(NAME sled_expected_test SRCS src/sled/nonstd/expected_test.cc) sled_add_test(NAME sled_config_test SRCS src/sled/config_test.cc) sled_add_test(NAME sled_ioc_test SRCS src/sled/ioc/ioc_test.cc) + sled_add_test(NAME sled_inja_test SRCS src/sled/nonstd/inja_test.cc) endif(SLED_BUILD_TESTS) if(SLED_BUILD_FUZZ) diff --git a/src/sled/nonstd/inja_test.cc b/src/sled/nonstd/inja_test.cc new file mode 100644 index 0000000..8b9934b --- /dev/null +++ b/src/sled/nonstd/inja_test.cc @@ -0,0 +1,13 @@ +#include + +TEST_SUITE("inja") +{ + TEST_CASE("render") + { + inja::json data; + data["a"] = 1; + data["b"] = "str"; + auto res = inja::render("{{ a }} {{ b }}", data); + CHECK_EQ(res, "1 str"); + } +}