优化 fillBefore 和 fillAfter。

This commit is contained in:
2023-05-30 11:20:21 +08:00
parent d9db0040d6
commit 25cf444960
2 changed files with 9 additions and 5 deletions

View File

@@ -11,12 +11,16 @@ class StrUtilTests {
@Test
void testFillZero() {
char c = '=';
log.info(StrUtil.fillBefore("1", 6, c));
log.info(StrUtil.fillBefore("12", 6, c));
log.info(StrUtil.fillBefore("123", 6, c));
log.info(StrUtil.fillBefore("1234", 6, c));
log.info(StrUtil.fillBefore("12345", 6, c));
log.info(StrUtil.fillBefore("123456", 6, c));
log.info(StrUtil.fillBefore("1234567", 6, c));
log.info(StrUtil.fillBefore("12345678", 6, c));
log.info(StrUtil.fillAfter("1", 6, c));
log.info(StrUtil.fillAfter("12", 6, c));
log.info(StrUtil.fillAfter("123", 6, c));
log.info(StrUtil.fillAfter("1234", 6, c));
log.info(StrUtil.fillAfter("12345", 6, c));