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

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

Issue 25785003: "Reverting 28184" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/html/svgelement_test.dart ('k') | tests/lib/math/rectangle_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/math/point_test.dart
diff --git a/tests/lib/math/point_test.dart b/tests/lib/math/point_test.dart
deleted file mode 100644
index d56c52904ed7c5db36726e432af2089b63a7e5ee..0000000000000000000000000000000000000000
--- a/tests/lib/math/point_test.dart
+++ /dev/null
@@ -1,122 +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.
-
-library point_test;
-
-import 'dart:math';
-import 'package:unittest/unittest.dart';
-
-main() {
- test('constructor', () {
- var point = new Point();
- expect(point.x, 0);
- expect(point.y, 0);
- expect('$point', '(0, 0)');
- });
-
- test('constructor X', () {
- var point = new Point<int>(10);
- expect(point.x, 10);
- expect(point.y, 0);
- expect('$point', '(10, 0)');
- });
-
- test('constructor X Y', () {
- var point = new Point<int>(10, 20);
- expect(point.x, 10);
- expect(point.y, 20);
- expect('$point', '(10, 20)');
- });
-
- test('constructor X Y double', () {
- var point = new Point<double>(10.5, 20.897);
- expect(point.x, 10.5);
- expect(point.y, 20.897);
- expect('$point', '(10.5, 20.897)');
- });
-
- test('constructor X Y NaN', () {
- var point = new Point(double.NAN, 1000);
- expect(point.x.isNaN, isTrue);
- expect(point.y, 1000);
- expect('$point', '(NaN, 1000)');
- });
-
- test('squaredDistanceTo', () {
- var a = new Point(7, 11);
- var b = new Point(3, -1);
- expect(a.squaredDistanceTo(b), 160);
- expect(b.squaredDistanceTo(a), 160);
- });
-
- test('distanceTo', () {
- var a = new Point(-2, -3);
- var b = new Point(2, 0);
- expect(a.distanceTo(b), 5);
- expect(b.distanceTo(a), 5);
- });
-
- test('subtract', () {
- var a = new Point(5, 10);
- var b = new Point(2, 50);
- expect(a - b, new Point(3, -40));
- });
-
- test('add', () {
- var a = new Point(5, 10);
- var b = new Point(2, 50);
- expect(a + b, new Point(7, 60));
- });
-
- test('ceil', () {
- var a = new Point(5.1, 10.8);
- expect(a.ceil(), new Point(6.0, 11.0));
-
- var b = new Point(5, 10);
- expect(b.ceil(), new Point(5, 10));
- });
-
- test('floor', () {
- var a = new Point(5.1, 10.8);
- expect(a.floor(), new Point(5.0, 10.0));
-
- var b = new Point(5, 10);
- expect(b.floor(), new Point(5, 10));
- });
-
- test('round', () {
- var a = new Point(5.1, 10.8);
- expect(a.round(), new Point(5.0, 11.0));
-
- var b = new Point(5, 10);
- expect(b.round(), new Point(5, 10));
- });
-
- test('truncate', () {
- var a = new Point(5.1, 10.8);
- var b = a.truncate();
- expect(b, new Point(5, 10));
- expect(b.x is int, isTrue);
- expect(b.y is int, isTrue);
- });
-
- test('hashCode', () {
- var a = new Point(0, 1);
- var b = new Point(0, 1);
- expect(a.hashCode, b.hashCode);
-
- 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 | « tests/html/svgelement_test.dart ('k') | tests/lib/math/rectangle_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698