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

Unified Diff: tests/lib_strong/math/point_test.dart

Issue 2995343002: Migrated test block 216 to Dart 2.0. (Closed)
Patch Set: Migrated min_max_test to Dart 2.0 Created 3 years, 4 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 | « tests/lib_strong/math/pi_test.dart ('k') | tests/lib_strong/math/random_big_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib_strong/math/point_test.dart
diff --git a/tests/lib_strong/math/point_test.dart b/tests/lib_strong/math/point_test.dart
deleted file mode 100644
index cb694b950de3b14ad49ac9e0741e723190dbab19..0000000000000000000000000000000000000000
--- a/tests/lib_strong/math/point_test.dart
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:math';
-import 'package:expect/expect.dart';
-
-main() {
- // constructor
- {
- var point = new Point(0, 0);
- Expect.equals(0, point.x);
- Expect.equals(0, point.y);
- Expect.equals('Point(0, 0)', '$point');
- }
-
- // constructor X
- {
- var point = new Point<int>(10, 0);
- Expect.equals(10, point.x);
- Expect.equals(0, point.y);
- Expect.equals('Point(10, 0)', '$point');
- }
-
- // constructor X Y
- {
- var point = new Point<int>(10, 20);
- Expect.equals(10, point.x);
- Expect.equals(20, point.y);
- Expect.equals('Point(10, 20)', '$point');
- }
-
- // constructor X Y double
- {
- var point = new Point<double>(10.5, 20.897);
- Expect.equals(10.5, point.x);
- Expect.equals(20.897, point.y);
- Expect.equals('Point(10.5, 20.897)', '$point');
- }
-
- // constructor X Y NaN
- {
- var point = new Point(double.NAN, 1000);
- Expect.isTrue(point.x.isNaN);
- Expect.equals(1000, point.y);
- Expect.equals('Point(NaN, 1000)', '$point');
- }
-
- // squaredDistanceTo
- {
- var a = new Point(7, 11);
- var b = new Point(3, -1);
- Expect.equals(160, a.squaredDistanceTo(b));
- Expect.equals(160, b.squaredDistanceTo(a));
- }
-
- // distanceTo
- {
- var a = new Point(-2, -3);
- var b = new Point(2, 0);
- Expect.equals(5, a.distanceTo(b));
- Expect.equals(5, b.distanceTo(a));
- }
-
- // subtract
- {
- var a = new Point(5, 10);
- var b = new Point(2, 50);
- Expect.equals(new Point(3, -40), a - b);
- }
-
- // add
- {
- var a = new Point(5, 10);
- var b = new Point(2, 50);
- Expect.equals(new Point(7, 60), a + b);
- }
-
- // hashCode
- {
- var a = new Point(0, 1);
- var b = new Point(0, 1);
- Expect.equals(b.hashCode, a.hashCode);
-
- var c = new Point(1, 0);
- Expect.isFalse(a.hashCode == c.hashCode);
- }
-
- // magnitude
- {
- var a = new Point(5, 10);
- var b = new Point(0, 0);
- Expect.equals(a.distanceTo(b), a.magnitude);
- Expect.equals(0, b.magnitude);
-
- var c = new Point(-5, -10);
- Expect.equals(a.distanceTo(b), c.magnitude);
- }
-}
« no previous file with comments | « tests/lib_strong/math/pi_test.dart ('k') | tests/lib_strong/math/random_big_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698