mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add tes
This commit is contained in:
parent
62aba99cf8
commit
562416e90d
@ -262,7 +262,7 @@ public class DateUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void secondToTime() {
|
||||
public void secondToTimeTest() {
|
||||
String time = DateUtil.secondToTime(3600);
|
||||
Assert.assertEquals("01:00:00", time);
|
||||
time = DateUtil.secondToTime(3800);
|
||||
@ -273,6 +273,15 @@ public class DateUtilTest {
|
||||
Assert.assertEquals("00:00:30", time);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void secondToTimeTest2() {
|
||||
String s1 = "55:02:18";
|
||||
String s2 = "55:00:50";
|
||||
int i = DateUtil.timeToSecond(s1) + DateUtil.timeToSecond(s2);
|
||||
String s = DateUtil.secondToTime(i);
|
||||
Assert.assertEquals("110:03:08", s);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseTest2() {
|
||||
// 转换时间与SimpleDateFormat结果保持一致即可
|
||||
|
Loading…
x
Reference in New Issue
Block a user