| 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 main() { | 7 main() { |
| 8 Duration d; | 8 Duration d; |
| 9 d = new Duration(days: 1); | 9 d = new Duration(days: 1); |
| 10 Expect.equals(86400000000, d.inMicroseconds); | 10 Expect.equals(86400000000, d.inMicroseconds); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 Expect.equals("0:00:00.099999", d.toString()); | 260 Expect.equals("0:00:00.099999", d.toString()); |
| 261 | 261 |
| 262 d = const Duration(microseconds: 100000); | 262 d = const Duration(microseconds: 100000); |
| 263 Expect.equals("0:00:00.100000", d.toString()); | 263 Expect.equals("0:00:00.100000", d.toString()); |
| 264 | 264 |
| 265 d = const Duration(microseconds: 999999); | 265 d = const Duration(microseconds: 999999); |
| 266 Expect.equals("0:00:00.999999", d.toString()); | 266 Expect.equals("0:00:00.999999", d.toString()); |
| 267 | 267 |
| 268 d = const Duration(microseconds: 1000000); | 268 d = const Duration(microseconds: 1000000); |
| 269 Expect.equals("0:00:01.000000", d.toString()); | 269 Expect.equals("0:00:01.000000", d.toString()); |
| 270 |
| 271 d1 = const Duration(hours: 1); |
| 272 d2 = const Duration(hours: -1); |
| 273 Expect.isFalse(d1.isNegative()); |
| 274 Expect.isTrue(d2.isNegative()); |
| 275 Expect.equals(d1, d1.abs()); |
| 276 Expect.equals(d1, d2.abs()); |
| 270 } | 277 } |
| OLD | NEW |