am 2f4c9bab: am 50e64e83: Merge "Add a unit test for a DateUtils bug I already fixed."
* commit '2f4c9babd90e14fab3c0fd6d01baec68a3e3d9f7':
Add a unit test for a DateUtils bug I already fixed.
diff --git a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
index 87b0c46..52f0d3f 100644
--- a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
+++ b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
@@ -284,4 +284,17 @@
DateUtils.formatDateRange(null, formatter, millis, millis, flags, "UTC");
return formatter.toString();
}
+
+ public void test_bug_7548161() {
+ long now = System.currentTimeMillis();
+ long today = now;
+ long tomorrow = now + DateUtils.DAY_IN_MILLIS;
+ long yesterday = now - DateUtils.DAY_IN_MILLIS;
+ assertEquals("Tomorrow", DateUtils.getRelativeTimeSpanString(tomorrow, now,
+ DateUtils.DAY_IN_MILLIS, 0));
+ assertEquals("Yesterday", DateUtils.getRelativeTimeSpanString(yesterday, now,
+ DateUtils.DAY_IN_MILLIS, 0));
+ assertEquals("Today", DateUtils.getRelativeTimeSpanString(today, now,
+ DateUtils.DAY_IN_MILLIS, 0));
+ }
}