| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 main() { | 7 main() { |
| 6 Duration d; | 8 Duration d; |
| 7 d = new Duration(days: 1); | 9 d = new Duration(days: 1); |
| 8 Expect.equals(86400000000, d.inMicroseconds); | 10 Expect.equals(86400000000, d.inMicroseconds); |
| 9 Expect.equals(86400000, d.inMilliseconds); | 11 Expect.equals(86400000, d.inMilliseconds); |
| 10 Expect.equals(86400, d.inSeconds); | 12 Expect.equals(86400, d.inSeconds); |
| 11 Expect.equals(1440, d.inMinutes); | 13 Expect.equals(1440, d.inMinutes); |
| 12 Expect.equals(24, d.inHours); | 14 Expect.equals(24, d.inHours); |
| 13 Expect.equals(1, d.inDays); | 15 Expect.equals(1, d.inDays); |
| 14 d = const Duration(hours: 1); | 16 d = const Duration(hours: 1); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 d = const Duration(hours: 1999, minutes: 17, seconds: 42); | 219 d = const Duration(hours: 1999, minutes: 17, seconds: 42); |
| 218 Expect.equals("1999:17:42.000000", d.toString()); | 220 Expect.equals("1999:17:42.000000", d.toString()); |
| 219 | 221 |
| 220 d = const Duration(days: -1, hours: -3, minutes: -17, seconds: -42, | 222 d = const Duration(days: -1, hours: -3, minutes: -17, seconds: -42, |
| 221 milliseconds: -823, microseconds: -127); | 223 milliseconds: -823, microseconds: -127); |
| 222 Expect.equals("-27:17:42.823127", d.toString()); | 224 Expect.equals("-27:17:42.823127", d.toString()); |
| 223 | 225 |
| 224 d = const Duration(hours: -1999, minutes: -17, seconds: -42); | 226 d = const Duration(hours: -1999, minutes: -17, seconds: -42); |
| 225 Expect.equals("-1999:17:42.000000", d.toString()); | 227 Expect.equals("-1999:17:42.000000", d.toString()); |
| 226 } | 228 } |
| OLD | NEW |