Fixed #19. Added support for removeLeft function

This commit is contained in:
Shekhar Gulati
2016-05-21 18:55:20 +05:30
parent 0aa874fa93
commit 2812d51da4
2 changed files with 50 additions and 0 deletions
+20
View File
@@ -504,4 +504,24 @@ public class StrmanTest {
assertThat(removeEmptyStrings(new String[]{"aa", "", " ", "bb", "cc", null}), arrayContaining("aa", "bb", "cc"));
assertThat(removeEmptyStrings(new String[0]), emptyArray());
}
@Test
public void removeLeft_shouldRemoveStringFromLeft() throws Exception {
final String[] fixture = {
"foobar",
"bar"
};
Arrays.stream(fixture).forEach(el -> assertThat(removeLeft(el, "foo"), equalTo("bar")));
}
@Test
public void removeLeft_shouldRemoveStringFromLeftCaseInSensitive() throws Exception {
final String[] fixture = {
"foobar",
"bar"
};
Arrays.stream(fixture).forEach(el -> assertThat(removeLeft(el, "FOO", false), equalTo("bar")));
}
}