mirror of
https://github.com/pantor/inja.git
synced 2026-10-07 12:57:17 +00:00
add utility to create regex of functions
This commit is contained in:
1 parent
570512ac95
commit
6153720155
2 files changed
+27
-8
No files matched your search
@@ -159,3 +159,9 @@ TEST_CASE("match-functions") {
|
||||
// CHECK_THROWS_WITH( inja::match("test(var)", map_regex), "Could not match input: test(var)" );
|
||||
// CHECK_THROWS_WITH( inja::match("round(var)", map_regex), "Could not match input: round(var)" );
|
||||
}
|
||||
|
||||
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("lower", 2).pattern() == "\\s*lower\\((.*),(.*)\\)\\s*" );
|
||||
}
|
||||
Reference in new issue
Block a user