Added support for chars function

This commit is contained in:
Shekhar Gulati
2016-05-04 19:08:21 +05:30
parent dce16e8290
commit 59da6a956f
3 changed files with 47 additions and 4 deletions
+6 -1
View File
@@ -6,7 +6,6 @@ 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.*;
@@ -58,4 +57,10 @@ public class StrmanTest {
assertThat(between("[abc][def]", "{", "}"), arrayContaining("[abc][def]"));
assertThat(between("", "{", "}"), arrayContaining(""));
}
@Test
public void charsShouldReturnAllCharactersInString() throws Exception {
final String title = "title";
assertThat(chars(title), equalTo(new String[]{"t", "i", "t", "l", "e"}));
}
}