LANG-815 DurationFormatUtils.formatPeriod() mis-calculation
Add test case to show there is no issue git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1390971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
77eed078c8
commit
cfab1e4fa1
|
@ -398,7 +398,19 @@ public class DurationFormatUtilsTest {
|
||||||
assertEqualDuration( "09", new int[] { 2005, 11, 31, 0, 0, 0 },
|
assertEqualDuration( "09", new int[] { 2005, 11, 31, 0, 0, 0 },
|
||||||
new int[] { 2006, 9, 6, 0, 0, 0 }, "MM");
|
new int[] { 2006, 9, 6, 0, 0, 0 }, "MM");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLANG815() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(2012, 6, 30, 0, 0, 0);
|
||||||
|
long startMillis = calendar.getTimeInMillis();
|
||||||
|
|
||||||
|
calendar.set(2012, 8, 8);
|
||||||
|
long endMillis = calendar.getTimeInMillis();
|
||||||
|
|
||||||
|
assertEquals("1 9", DurationFormatUtils.formatPeriod(startMillis, endMillis, "M d"));
|
||||||
|
}
|
||||||
|
|
||||||
// Testing the under a day range in DurationFormatUtils.formatPeriod
|
// Testing the under a day range in DurationFormatUtils.formatPeriod
|
||||||
@Test
|
@Test
|
||||||
public void testLowDurations() {
|
public void testLowDurations() {
|
||||||
|
|
Loading…
Reference in New Issue