This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push:
new 3b20166 More tests.
3b20166 is described below
commit 3b20166d554f8c44e37c3744a4e4ca67a4a4d0c8
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jul 11 11:59:27 2020 -0400
More tests.
---
src/test/java/org/apache/commons/text/StringSubstitutorTest.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index b143fd5..a4c7418 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -188,6 +188,7 @@ public class StringSubstitutorTest {
values.put("b", "2");
values.put("bb", "22");
values.put("bbb", "222");
+ values.put("a2b", "b");
// normal key and value.
values.put("animal", ACTUAL_ANIMAL);
values.put("target", ACTUAL_TARGET);
@@ -472,6 +473,12 @@ public class StringSubstitutorTest {
.isThrownBy(() -> replace(sub, "The
${test.${statement.${recursive}}} is a sample for missing ${word}."))
.withMessage("Cannot resolve variable 'test.2'
(enableSubstitutionInVariables=true).");
+ assertEqualsCharSeq("statement",
+ replace(sub, "${testok.${statement.${recursive}}}"));
+
+ assertEqualsCharSeq("${testok.2}",
+ replace(sub, "$${testok.${statement.${recursive}}}"));
+
assertEqualsCharSeq("The statement is a sample for missing variable.",
replace(sub, "The ${testok.${statement.${recursive}}} is a sample
for missing ${word}."));
}