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

Side by Side Diff: tests/lib/math/point_test.dart

Issue 332663002: pkg/matcher: add isNaN and isNotNaN matchers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removing parens Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/matcher/test/core_matchers_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library point_test; 5 library point_test;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 main() { 10 main() {
(...skipping 20 matching lines...) Expand all
31 31
32 test('constructor X Y double', () { 32 test('constructor X Y double', () {
33 var point = new Point<double>(10.5, 20.897); 33 var point = new Point<double>(10.5, 20.897);
34 expect(point.x, 10.5); 34 expect(point.x, 10.5);
35 expect(point.y, 20.897); 35 expect(point.y, 20.897);
36 expect('$point', 'Point(10.5, 20.897)'); 36 expect('$point', 'Point(10.5, 20.897)');
37 }); 37 });
38 38
39 test('constructor X Y NaN', () { 39 test('constructor X Y NaN', () {
40 var point = new Point(double.NAN, 1000); 40 var point = new Point(double.NAN, 1000);
41 expect(point.x.isNaN, isTrue); 41 expect(point.x, isNaN);
42 expect(point.y, 1000); 42 expect(point.y, 1000);
43 expect('$point', 'Point(NaN, 1000)'); 43 expect('$point', 'Point(NaN, 1000)');
44 }); 44 });
45 45
46 test('squaredDistanceTo', () { 46 test('squaredDistanceTo', () {
47 var a = new Point(7, 11); 47 var a = new Point(7, 11);
48 var b = new Point(3, -1); 48 var b = new Point(3, -1);
49 expect(a.squaredDistanceTo(b), 160); 49 expect(a.squaredDistanceTo(b), 160);
50 expect(b.squaredDistanceTo(a), 160); 50 expect(b.squaredDistanceTo(a), 160);
51 }); 51 });
(...skipping 29 matching lines...) Expand all
81 test('magnitute', () { 81 test('magnitute', () {
82 var a = new Point(5, 10); 82 var a = new Point(5, 10);
83 var b = new Point(0, 0); 83 var b = new Point(0, 0);
84 expect(a.magnitude, a.distanceTo(b)); 84 expect(a.magnitude, a.distanceTo(b));
85 expect(b.magnitude, 0); 85 expect(b.magnitude, 0);
86 86
87 var c = new Point(-5, -10); 87 var c = new Point(-5, -10);
88 expect(c.magnitude, a.distanceTo(b)); 88 expect(c.magnitude, a.distanceTo(b));
89 }); 89 });
90 } 90 }
OLDNEW
« no previous file with comments | « pkg/matcher/test/core_matchers_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698