Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: tests/corelib/duration_test.dart

Issue 431263004: Adding Duration documentation, abs(), and isNegative() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sdk/lib/core/duration.dart ('K') | « sdk/lib/core/duration.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/duration_test.dart
diff --git a/tests/corelib/duration_test.dart b/tests/corelib/duration_test.dart
index 306873db87ef2adb7654a70cdc2062c7475f4f5d..5d8e0f1db38422115e6053de27bccfd7e0d184b7 100644
--- a/tests/corelib/duration_test.dart
+++ b/tests/corelib/duration_test.dart
@@ -267,4 +267,11 @@ main() {
d = const Duration(microseconds: 1000000);
Expect.equals("0:00:01.000000", d.toString());
+
+ d1 = const Duration(hours: 1);
+ d2 = const Duration(hours: -1);
+ Expect.isFalse(d1.isNegative());
+ Expect.isTrue(d2.isNegative());
+ Expect.equals(d1, d1.abs());
+ Expect.equals(d1, d2.abs());
}
« sdk/lib/core/duration.dart ('K') | « sdk/lib/core/duration.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698