Use callbacks without parameters either with or without parenthesis

This commit is contained in:
pantor
2018-03-19 10:46:49 +01:00
parent b68f745866
commit 776af96b0b
3 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -159,6 +159,6 @@ TEST_CASE("match-functions") {
TEST_CASE("create-regex-functions") {
CHECK( inja::Parser::function_regex("upper", 1).pattern() == "\\s*upper\\((.*)\\)\\s*" );
CHECK( inja::Parser::function_regex("upper", 0).pattern() == "\\s*upper\\s*" );
CHECK( inja::Parser::function_regex("upper", 0).pattern() == "\\s*(?:upper|upper\\(\\))\\s*" );
CHECK( inja::Parser::function_regex("lower", 2).pattern() == "\\s*lower\\((.*),(.*)\\)\\s*" );
}