mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-18 05:23:59 +00:00
Fixed #13. Added support for leftPad function
This commit is contained in:
@@ -430,4 +430,14 @@ public class StrmanTest {
|
||||
assertThat(last("", 3), equalTo(""));
|
||||
assertThat(last("f", 3), equalTo("f"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void leftPad_shouldAddPaddingOnTheLeft() throws Exception {
|
||||
assertThat(leftPad("1", "0", 5), equalTo("00001"));
|
||||
assertThat(leftPad("01", "0", 5), equalTo("00001"));
|
||||
assertThat(leftPad("001", "0", 5), equalTo("00001"));
|
||||
assertThat(leftPad("0001", "0", 5), equalTo("00001"));
|
||||
assertThat(leftPad("00001", "0", 5), equalTo("00001"));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user