mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-08 04:43:57 +00:00
Added support for between function
This commit is contained in:
@@ -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("<span>foo</span>", "<span>", "</span>"), arrayContaining("foo"));
|
||||
assertThat(between("<span>foo</span><span>bar</span>", "<span>", "</span>"), arrayContaining("foo", "bar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void betweenShouldReturnFullStringWhenStartAndEndDoesNotExist() throws Exception {
|
||||
assertThat(between("[abc][def]", "{", "}"), arrayContaining("[abc][def]"));
|
||||
assertThat(between("", "{", "}"), arrayContaining(""));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user