From dce16e82907f53a40fe727ca3928e26269f75a8e Mon Sep 17 00:00:00 2001 From: Shekhar Gulati Date: Wed, 4 May 2016 18:47:12 +0530 Subject: [PATCH] Added support for `between` function --- src/test/java/strman/StrmanTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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