Skip to content

Commit

Permalink
Adapted to new Conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Oct 31, 2018
1 parent 669b722 commit 41a19d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ private void assertMatcher(String str, String... groups) {
if (groups.length == 0) {
return;
}
assertEquals(3, matcher.groupCount(), "Number of regexp group count.");
assertEquals(groups[0], matcher.group(1));
assertEquals(groups[1], matcher.group(2));
assertEquals(4, matcher.groupCount(), "Number of regexp group count.");
assertEquals(groups[0], matcher.group(2));
assertEquals(groups[1], matcher.group(3));
String[] params = CSVStringUtils.parseStringList(matcher.group(3));
assertEquals(groups.length - 2, params.length, "Number of comma separated values.");
for (int i = 2; i < groups.length; i++) {
assertEquals(groups[i], params[i - 2]);
for (int i = 3; i < groups.length; i++) {
assertEquals(groups[i], params[i - 3]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ private void assertBeginIfPatternMatch(boolean expected, String str, String var,
Matcher matcher = AbstractConditional.beginIfPattern.matcher(str);
assertEquals(expected, matcher.find());
if (expected) {
assertEquals(var, matcher.group(1), "Variable.");
assertEquals(cmp, matcher.group(2), "Comparison.");
assertEquals(value, matcher.group(3), "Value.");
assertEquals(var, matcher.group(2), "Variable.");
assertEquals(cmp, matcher.group(3), "Comparison.");
assertEquals(value, matcher.group(4), "Value.");
}
}

Expand Down

0 comments on commit 41a19d6

Please sign in to comment.