From b975cc1c205eed40b397cbb65790724945de2064 Mon Sep 17 00:00:00 2001 From: Wander Nauta Date: Sun, 14 Jun 2026 15:07:11 +0200 Subject: [PATCH] check inja template syntax in test runner This is a regression test for 2bb9806. Example output: =============================================================================== ../testrunner.cc:149: TEST CASE: Inja template syntax partials/zaak.html ../testrunner.cc:157: ERROR: CHECK_NOTHROW( env.parse_template(entry.path()) ) THREW exception: "[inja.exception.parser_error] (at 3:39) unexpected '}'" =============================================================================== --- testrunner.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testrunner.cc b/testrunner.cc index 8368c98..0395ecb 100644 --- a/testrunner.cc +++ b/testrunner.cc @@ -13,6 +13,7 @@ #include "nlohmann/json.hpp" #include "meta.hh" #include "support.hh" +#include using namespace std; @@ -145,3 +146,17 @@ Dit was een bericht van OpenTK. } +TEST_CASE("Inja template syntax") { + inja::Environment env; + + for (const auto& entry : std::filesystem::directory_iterator("partials")) { + std::filesystem::path ext = entry.path().extension(); + + if (ext == ".html" || ext == ".txt") { + SUBCASE(entry.path().c_str()) { + CHECK_NOTHROW(env.parse_template(entry.path())); + } + } + } +} +