Fixed #11. Added support for last function

This commit is contained in:
Shekhar Gulati
2016-05-20 20:03:33 +05:30
parent 6986e34fd3
commit 08945f3d04
2 changed files with 23 additions and 0 deletions
+8
View File
@@ -422,4 +422,12 @@ public class StrmanTest {
assertThat(isUpperCase("Foo"), equalTo(false));
assertThat(isUpperCase("foobarfooA"), equalTo(false));
}
@Test
public void last_shouldReturnLastNChars() throws Exception {
assertThat(last("foo", 3), equalTo("foo"));
assertThat(last("foobarfoo", 3), equalTo("foo"));
assertThat(last("", 3), equalTo(""));
assertThat(last("f", 3), equalTo("f"));
}
}