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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 d1 = const Duration(hours: 1); | 284 d1 = const Duration(hours: 1); |
285 d2 = const Duration(hours: -1); | 285 d2 = const Duration(hours: -1); |
286 Expect.isFalse(d1.isNegative); | 286 Expect.isFalse(d1.isNegative); |
287 Expect.isTrue(d2.isNegative); | 287 Expect.isTrue(d2.isNegative); |
288 Expect.equals(d1, d1.abs()); | 288 Expect.equals(d1, d1.abs()); |
289 Expect.equals(d1, d2.abs()); | 289 Expect.equals(d1, d2.abs()); |
290 | 290 |
291 Expect.equals(d2, -d1); | 291 Expect.equals(d2, -d1); |
292 Expect.equals(d1, -d2); | 292 Expect.equals(d1, -d2); |
293 } | 293 } |
OLD | NEW |