mirror of
https://github.com/pantor/inja.git
synced 2026-08-03 06:12:16 +00:00
crop image, more enum classes
This commit is contained in:
@@ -75,11 +75,11 @@ TEST_CASE("Parse structure") {
|
||||
}
|
||||
|
||||
SECTION("Basic conditional") {
|
||||
std::string test = "{% if true %}dfgh{% endif %}";
|
||||
std::string test = "{% if true %}Hello{% endif %}";
|
||||
json result = {
|
||||
{{"type", Type::Condition}, {"children", {
|
||||
{{"type", Type::ConditionBranch}, {"command", "if true"}, {"children", {
|
||||
{{"type", Type::String}, {"text", "dfgh"}}
|
||||
{{"type", Type::String}, {"text", "Hello"}}
|
||||
}}}
|
||||
}}}
|
||||
};
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
#include "inja.hpp"
|
||||
|
||||
|
||||
using Environment = inja::Environment;
|
||||
using json = nlohmann::json;
|
||||
|
||||
|
||||
TEST_CASE("Renderer") {
|
||||
Environment env = Environment();
|
||||
inja::Environment env = inja::Environment();
|
||||
json data;
|
||||
data["name"] = "Peter";
|
||||
data["city"] = "Brunswick";
|
||||
|
||||
@@ -59,7 +59,7 @@ TEST_CASE("Search on level") {
|
||||
CHECK( open_match.end_position() == 8 );
|
||||
CHECK( open_match.str(1) == "up" );
|
||||
|
||||
inja::MatchClosed match = inja::search_closed_match_on_level(input, regex_statement, regex_level_up, regex_level_down, regex_search, open_match);
|
||||
inja::MatchClosed match = inja::search_closed_on_level(input, regex_statement, regex_level_up, regex_level_down, regex_search, open_match);
|
||||
CHECK( match.position() == 0 );
|
||||
CHECK( match.end_position() == 109 );
|
||||
}
|
||||
@@ -71,7 +71,7 @@ TEST_CASE("Search on level") {
|
||||
CHECK( open_match.end_position() == 16 );
|
||||
CHECK( open_match.str(1) == "up" );
|
||||
|
||||
inja::MatchClosed match = inja::search_closed_match_on_level(input, regex_statement, regex_level_up, regex_level_down, regex_search, open_match);
|
||||
inja::MatchClosed match = inja::search_closed_on_level(input, regex_statement, regex_level_up, regex_level_down, regex_search, open_match);
|
||||
|
||||
CHECK( match.open_match.position() == 8 );
|
||||
CHECK( match.open_match.end_position() == 16 );
|
||||
|
||||
Reference in New Issue
Block a user