feat add inja test
All checks were successful
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 1m30s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 2m5s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 2m17s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 2m22s
linux-arm-gcc / linux-gcc-armhf (push) Successful in 2m41s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m45s

This commit is contained in:
tqcq 2024-04-10 23:01:22 +08:00
parent d93e4802c7
commit 8d76becf1c
2 changed files with 14 additions and 0 deletions

View File

@ -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_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_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_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) endif(SLED_BUILD_TESTS)
if(SLED_BUILD_FUZZ) if(SLED_BUILD_FUZZ)

View File

@ -0,0 +1,13 @@
#include <sled/nonstd/inja.h>
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");
}
}