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

Unified Diff: tests/html/point_test.dart

Issue 21619004: Add magnitude getter to Point. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/Point.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/point_test.dart
diff --git a/tests/html/point_test.dart b/tests/html/point_test.dart
index 7a4fdbded4935a54450c03d67aefd077fb0a527e..ef1fe5a6c42f1357e3d2c3bab48a017f55cde9bb 100644
--- a/tests/html/point_test.dart
+++ b/tests/html/point_test.dart
@@ -112,4 +112,14 @@ main() {
var c = new Point(1, 0);
expect(a.hashCode == c.hashCode, isFalse);
});
+
+ test('magnitute', () {
+ var a = new Point(5, 10);
+ var b = new Point(0, 0);
+ expect(a.magnitude, a.distanceTo(b));
+ expect(b.magnitude, 0);
+
+ var c = new Point(-5, -10);
+ expect(c.magnitude, a.distanceTo(b));
+ });
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/Point.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698