More tests.
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index 4eaa12e..3465fea 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -66,6 +66,11 @@
doTestNoReplace(new StringSubstitutor(values), replaceTemplate);
}
+ protected void doReplace(final String expectedResult, final String replaceTemplate, final boolean substring)
+ throws IOException {
+ doTestReplace(new StringSubstitutor(values), expectedResult, replaceTemplate, substring);
+ }
+
protected void doTestNoReplace(final StringSubstitutor substitutor, final String replaceTemplate)
throws IOException {
if (replaceTemplate == null) {
@@ -90,11 +95,6 @@
}
}
- protected void doReplace(final String expectedResult, final String replaceTemplate, final boolean substring)
- throws IOException {
- doTestReplace(new StringSubstitutor(values), expectedResult, replaceTemplate, substring);
- }
-
protected void doTestReplace(final StringSubstitutor sub, final String expectedResult, final String replaceTemplate,
final boolean substring) throws IOException {
final String expectedShortResult = substring ? expectedResult.substring(1, expectedResult.length() - 1)
@@ -264,6 +264,28 @@
}
/**
+ * Tests interpolation with weird boundary patterns.
+ */
+ @Test
+ @Disabled
+ public void testReplace_JiraText178_WeirdPattens() throws IOException {
+ doNotReplace("$${");
+ doNotReplace("$${a");
+ doNotReplace("$$${");
+ doNotReplace("$$${a");
+ doNotReplace("$${${a");
+ }
+
+ /**
+ * Tests interpolation with weird boundary patterns.
+ */
+ @Test
+ @Disabled
+ public void testReplace_JiraText178_WeirdPattens_Partial() throws IOException {
+ doReplace("$${1", "$${${a}", false);
+ }
+
+ /**
* Tests adjacent keys.
*/
@Test
@@ -932,31 +954,10 @@
doNotReplace("${$$${a}}");
doNotReplace("${$$${a}}");
doNotReplace("${${${a}");
- }
-
- /**
- * Tests interpolation with weird boundary patterns.
- */
- @Test
- @Disabled
- public void testReplaceWeirdPattensNo_JiraText178() throws IOException {
- doNotReplace("$${");
- doNotReplace("$${a");
- doNotReplace("$$${");
- doNotReplace("$$${a");
- doNotReplace("$${${a");
- }
-
- /**
- * Tests interpolation with weird boundary patterns.
- */
- @Test
- @Disabled
- public void testReplaceWeirdPattens_Partial_JiraText178() throws IOException {
+ //
doReplace("${1}", "$${${a}}", false);
doReplace("${12}", "$${${a}${b}}", false);
doReplace("${${${a}2", "${${${a}${b}", false);
- doReplace("$${1", "$${${a}", false);
}
/**