mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-09 05:43:56 +00:00
Fixed #26. Added support for rightPad function
This commit is contained in:
@@ -602,4 +602,14 @@ public class StrmanTest {
|
||||
assertThat(reverse("foo_"), equalTo("_oof"));
|
||||
assertThat(reverse("f"), equalTo("f"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rightPad_shouldRightPadAString() throws Exception {
|
||||
assertThat(rightPad("1", "0", 5), equalTo("10000"));
|
||||
assertThat(rightPad("10", "0", 5), equalTo("10000"));
|
||||
assertThat(rightPad("100", "0", 5), equalTo("10000"));
|
||||
assertThat(rightPad("1000", "0", 5), equalTo("10000"));
|
||||
assertThat(rightPad("10000", "0", 5), equalTo("10000"));
|
||||
assertThat(rightPad("10000000", "0", 5), equalTo("10000000"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user