diff --git a/src/test/java/strman/StrmanTest.java b/src/test/java/strman/StrmanTest.java index 31a551c..b8b173a 100644 --- a/src/test/java/strman/StrmanTest.java +++ b/src/test/java/strman/StrmanTest.java @@ -6,6 +6,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.collection.IsArrayContainingInOrder.arrayContaining; +import static org.hamcrest.collection.IsArrayWithSize.emptyArray; import static org.junit.Assert.assertThat; import static strman.Strman.*; @@ -51,4 +52,10 @@ public class StrmanTest { assertThat(between("foo", "", ""), arrayContaining("foo")); assertThat(between("foobar", "", ""), arrayContaining("foo", "bar")); } + + @Test + public void betweenShouldReturnFullStringWhenStartAndEndDoesNotExist() throws Exception { + assertThat(between("[abc][def]", "{", "}"), arrayContaining("[abc][def]")); + assertThat(between("", "{", "}"), arrayContaining("")); + } } \ No newline at end of file