Skip to content

Commit

Permalink
Testing exact matching of single variable #122
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Jun 19, 2019
1 parent a65764e commit 13bce9c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/java/org/jenkinsci/plugins/gwt/RendererTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ public void testThatIsMatchingAcceptsIfMatching() {
.isTrue();
}

@Test
public void testThatExactValueOfSingleVariableCanBeMatched() {
resolvedVariables = new TreeMap<>();
resolvedVariables.put("PR_TO_BRANCH", "master");

final String text = "$PR_TO_BRANCH";

final String actualRendered = renderText(text, resolvedVariables);
assertThat(actualRendered) //
.isEqualTo("master");

regexpFilterExpression = "^master$";
final boolean actual = isMatching(actualRendered, regexpFilterExpression);
assertThat(actual) //
.isTrue();
}

@Test
public void testThatVariablesAreResolvedWithLongestVariableFirst() {
resolvedVariables = new TreeMap<>();
Expand Down

0 comments on commit 13bce9c

Please sign in to comment.