crop image, more enum classes

This commit is contained in:
pantor
2017-08-20 13:15:57 +02:00
parent f2ac74fc5a
commit dd65af4457
5 changed files with 189 additions and 136 deletions
+2 -2
View File
@@ -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"}}
}}}
}}}
};
+1 -2
View File
@@ -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";
+2 -2
View File
@@ -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 );