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 06574de Split test method. 06574de is described below commit 06574de73c8a9951a1e455a4a7f8c279ab458aa3 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Mon Jun 29 10:53:14 2020 -0400 Split test method. --- .../apache/commons/text/StringSubstitutorTest.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java index 108c15a..e478bde 100644 --- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java +++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java @@ -265,11 +265,17 @@ public class StringSubstitutorTest { * Tests when no variable name. */ @Test - public void testReplaceEmptyKeyOnly() throws IOException { - assertEquals(EMPTY_EXPR, replace(new StringSubstitutor(values), EMPTY_EXPR)); - String expected = EMPTY_EXPR + " "; + public void testReplaceEmptyKeyExtra1() throws IOException { + final String expected = EMPTY_EXPR + " "; assertEquals(expected, replace(new StringSubstitutor(values), expected)); - expected = " " + EMPTY_EXPR; + } + + /** + * Tests when no variable name. + */ + @Test + public void testReplaceEmptyKeyExtra2() throws IOException { + final String expected = " " + EMPTY_EXPR; assertEquals(expected, replace(new StringSubstitutor(values), expected)); } @@ -277,6 +283,14 @@ public class StringSubstitutorTest { * Tests when no variable name. */ @Test + public void testReplaceEmptyKeyOnly() throws IOException { + assertEquals(EMPTY_EXPR, replace(new StringSubstitutor(values), EMPTY_EXPR)); + } + + /** + * Tests when no variable name. + */ + @Test public void testReplaceEmptyKeyWithDefault() throws IOException { doTestReplace("The animal jumps over the lazy dog.", "The ${:-animal} jumps over the ${target}.", true); }