mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
0c5444e442
commit
ae1a18cd20
@ -1,12 +1,13 @@
|
||||
package cn.hutool.core.date;
|
||||
|
||||
import cn.hutool.core.date.BetweenFormatter.Level;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class DateBetweenTest {
|
||||
|
||||
@Test
|
||||
@ -36,6 +37,14 @@ public class DateBetweenTest {
|
||||
assertEquals(18, betweenYear);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void betweenYearTest3() {
|
||||
Date start = DateUtil.parse("20170301");
|
||||
Date end = DateUtil.parse("2024-02-29 14:56:18");
|
||||
long betweenYear = new DateBetween(start, end).betweenYear(false);
|
||||
assertEquals(6, betweenYear);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void betweenMonthTest() {
|
||||
Date start = DateUtil.parse("2017-02-01 12:23:46");
|
||||
|
Loading…
x
Reference in New Issue
Block a user