aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-01-04 23:14:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-01-04 23:14:05 +0000
commit649fc2b4b11e7730704ecdb8048da3c16f2cbba9 (patch)
tree43c69e4fce3c0a84e24c5a85db82a8f4110c6d50
parent667e616742097d47a6ec0f2403c8523ef13f7b7a (diff)
parent2b93f7f9da6dc2d4a82e9dcdf549d1c76873961a (diff)
downloadlibcore-android-9.0.0_r38.tar.gz
Snap for 5210576 from 2b93f7f9da6dc2d4a82e9dcdf549d1c76873961a to pi-b4s4-releaseandroid-9.0.0_r39android-9.0.0_r38pie-b4s4-release
Change-Id: If2c14e9ecb8ef7a257abbebec8e16f1ca8dc4d19
-rw-r--r--luni/src/test/java/libcore/libcore/icu/DateIntervalFormatTest.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/luni/src/test/java/libcore/libcore/icu/DateIntervalFormatTest.java b/luni/src/test/java/libcore/libcore/icu/DateIntervalFormatTest.java
index 6b33f13bd60..7d2cb93b4ee 100644
--- a/luni/src/test/java/libcore/libcore/icu/DateIntervalFormatTest.java
+++ b/luni/src/test/java/libcore/libcore/icu/DateIntervalFormatTest.java
@@ -439,34 +439,38 @@ public class DateIntervalFormatTest extends junit.framework.TestCase {
int dateTimeFlags = FORMAT_SHOW_DATE | FORMAT_SHOW_TIME | FORMAT_24HOUR;
// If we're showing times and the end-point is midnight the following day, we want the
// behaviour of suppressing the date for the end...
- assertEquals("February 27, 04:00 – 00:00",
+ assertEquals("February 27, 2018, 04:00 – 00:00",
formatDateRange(locale, timeZone, 1519704000000L, 1519776000000L, dateTimeFlags));
// ...unless the start-point is also midnight, in which case we need dates to disambiguate.
- assertEquals("February 27, 00:00 – February 28, 00:00",
+ assertEquals("February 27, 2018, 00:00 – February 28, 2018, 00:00",
formatDateRange(locale, timeZone, 1519689600000L, 1519776000000L, dateTimeFlags));
// We want to show the date if the end-point is a millisecond after midnight the following
// day, or if it is exactly midnight the day after that.
- assertEquals("February 27, 04:00 – February 28, 00:00",
+ assertEquals("February 27, 2018, 04:00 – February 28, 2018, 00:00",
formatDateRange(locale, timeZone, 1519704000000L, 1519776000001L, dateTimeFlags));
- assertEquals("February 27, 04:00 – March 1, 00:00",
+ assertEquals("February 27, 2018, 04:00 – March 1, 2018, 00:00",
formatDateRange(locale, timeZone, 1519704000000L, 1519862400000L, dateTimeFlags));
// We want to show the date if the start-point is anything less than a minute after midnight,
// since that gets displayed as midnight...
- assertEquals("February 27, 00:00 – February 28, 00:00",
+ assertEquals("February 27, 2018, 00:00 – February 28, 2018, 00:00",
formatDateRange(locale, timeZone, 1519689659999L, 1519776000000L, dateTimeFlags));
// ...but not if it is exactly one minute after midnight.
- assertEquals("February 27, 00:01 – 00:00",
+ assertEquals("February 27, 2018, 00:01 – 00:00",
formatDateRange(locale, timeZone, 1519689660000L, 1519776000000L, dateTimeFlags));
int dateOnlyFlags = FORMAT_SHOW_DATE;
// If we're only showing dates and the end-point is midnight of any day, we want the
// behaviour of showing an end date one earlier. So if the end-point is March 2, 00:00, show
// March 1 instead (whether the start-point is midnight or not).
- assertEquals("February 27 – March 1",
+ assertEquals("February 27 – March 1, 2018",
formatDateRange(locale, timeZone, 1519689600000L, 1519948800000L, dateOnlyFlags));
- assertEquals("February 27 – March 1",
+ assertEquals("February 27 – March 1, 2018",
formatDateRange(locale, timeZone, 1519704000000L, 1519948800000L, dateOnlyFlags));
// We want to show the true date if the end-point is a millisecond after midnight.
- assertEquals("February 27 – March 2",
+ assertEquals("February 27 – March 2, 2018",
formatDateRange(locale, timeZone, 1519689600000L, 1519948800001L, dateOnlyFlags));
+
+ // 2017-02-27 00:00:00.000 GMT - 2018-03-02 00:00:00.000 GMT
+ assertEquals("February 27, 2017 – March 1, 2018",
+ formatDateRange(locale, timeZone, 1488153600000L, 1519948800000L, dateOnlyFlags));
}
}