| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 5 // Test fromString with 6 digits after the decimal point. | 7 // Test fromString with 6 digits after the decimal point. |
| 6 | 8 |
| 7 main() { | 9 main() { |
| 8 // We only support milliseconds. If the user supplies more data (the "51" | 10 // We only support milliseconds. If the user supplies more data (the "51" |
| 9 // here), we round. | 11 // here), we round. |
| 10 // If (eventually) we support more than just milliseconds this test could | 12 // If (eventually) we support more than just milliseconds this test could |
| 11 // fail. Please update the test in this case. | 13 // fail. Please update the test in this case. |
| 12 DateTime dt1 = DateTime.parse("1999-01-02 23:59:59.999519"); | 14 DateTime dt1 = DateTime.parse("1999-01-02 23:59:59.999519"); |
| 13 Expect.equals(1999, dt1.year); | 15 Expect.equals(1999, dt1.year); |
| 14 Expect.equals(1, dt1.month); | 16 Expect.equals(1, dt1.month); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 41 Expect.equals(2012, dt1.year); | 43 Expect.equals(2012, dt1.year); |
| 42 Expect.equals(3, dt1.month); | 44 Expect.equals(3, dt1.month); |
| 43 Expect.equals(30, dt1.day); | 45 Expect.equals(30, dt1.day); |
| 44 Expect.equals(4, dt1.hour); | 46 Expect.equals(4, dt1.hour); |
| 45 Expect.equals(28, dt1.minute); | 47 Expect.equals(28, dt1.minute); |
| 46 Expect.equals(13, dt1.second); | 48 Expect.equals(13, dt1.second); |
| 47 Expect.equals(752, dt1.millisecond); | 49 Expect.equals(752, dt1.millisecond); |
| 48 Expect.equals(true, dt1.isUtc); | 50 Expect.equals(true, dt1.isUtc); |
| 49 | 51 |
| 50 } | 52 } |
| OLD | NEW |