Index: tests/corelib/date_time_test.dart |
diff --git a/tests/corelib/date_time_test.dart b/tests/corelib/date_time_test.dart |
index 7c2940a4c5723f8e6c12366fae090710abe418d7..9a9de1cfee66dbf6122321c8030f8f8f741d4c25 100644 |
--- a/tests/corelib/date_time_test.dart |
+++ b/tests/corelib/date_time_test.dart |
@@ -37,6 +37,11 @@ void testMillisecondsSinceEpoch() { |
} |
void testMicrosecondsSinceEpoch() { |
+ // We chose a millisecondSinceEpoch that is guaranteed to fit into 53 |
+ // bits when expressed as microseconds. Furthermore the microsecond part |
+ // is equal to 0, which means that an implementation that discards (or |
+ // rounds) microseconds should yield correct results for the following |
+ // test. |
var dt1 = new DateTime.fromMillisecondsSinceEpoch(1); |
var microsecondsSinceEpoch = dt1.microsecondsSinceEpoch; |
var dt2 = new DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch); |
@@ -44,7 +49,7 @@ void testMicrosecondsSinceEpoch() { |
if (!supportsMicroseconds) return; |
dt1 = new DateTime.now(); |
- microsecondsSinceEpoch = dt1.millisecondsSinceEpoch; |
+ microsecondsSinceEpoch = dt1.microsecondsSinceEpoch; |
dt2 = new DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch); |
Expect.equals(microsecondsSinceEpoch, dt2.microsecondsSinceEpoch); |
} |