mirror of
https://github.com/pantor/inja.git
synced 2026-03-05 16:56:24 +00:00
* Fix for issue #80 When updating the `opening_chars`, line_statment was forgotten. So, a change to any of the openers would cause line statements to start being unrecognized. I added a unit test to cover this case. * fix indentation * add update to single_include
This commit is contained in:
@@ -388,4 +388,17 @@ TEST_CASE("other-syntax") {
|
||||
CHECK( env.render("Hello {# Test #}", data) == "Hello {# Test #}" );
|
||||
CHECK( env.render("Hello (& Test &)", data) == "Hello " );
|
||||
}
|
||||
|
||||
SECTION("multiple changes") {
|
||||
inja::Environment env;
|
||||
env.set_line_statement("$$");
|
||||
env.set_expression("<%", "%>");
|
||||
|
||||
std::string string_template = R"DELIM(Hello <%name%>
|
||||
$$ if name == "Peter"
|
||||
You really are <%name%>
|
||||
$$ endif
|
||||
)DELIM";
|
||||
CHECK( env.render(string_template, data) == "Hello Peter\n You really are Peter\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user