Skip to content

Commit

Permalink
Fix evaluation of template expressions (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfinocchiaro authored Dec 17, 2024
1 parent f3fde30 commit 580ba7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public boolean equals(Object obj) {
private static Pattern TEMPLATE_GLOBAL =
Pattern.compile("(^[a-zA-Z0-9_-]+)(-" + SELECTION_REGEX + ")$");
private static Pattern TEMPLATE_LOCAL =
Pattern.compile("(([a-zA-Z\\._]\\w*)=([a-zA-Z0-9\\.\\[\\]\\*]+)),?");
Pattern.compile("(([a-zA-Z\\._]\\w*)=([a-zA-Z0-9_\\.\\[\\]\\*]+)),?");
private static Pattern SUBSCRIBED_GLOBAL = Pattern.compile("([a-zA-Z0-9_-]+)(-\\[(.*)\\])?");
private static Pattern SUBSCRIBED_LOCAL = Pattern.compile("(([a-zA-Z\\._]\\w*)=([^,]+)),?");
private static Pattern FIELD = Pattern.compile(SELECTION_REGEX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ static Stream<Arguments> templateArgs() {
arguments(
"template-#{param1=OFFSET,param2=PARTITION,param3=TIMESTAMP}",
"template",
Map.of("param1", "OFFSET", "param2", "PARTITION", "param3", "TIMESTAMP")));
Map.of("param1", "OFFSET", "param2", "PARTITION", "param3", "TIMESTAMP")),
arguments(
"template-#{param1=VALUE.complex_attrib_name.child_1_}",
"template",
Map.of("param1", "VALUE.complex_attrib_name.child_1_")));
}

@ParameterizedTest
Expand Down

0 comments on commit 580ba7a

Please sign in to comment.