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

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

Issue 41073004: Fix Rectangle test with method name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « no previous file | 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 rect_test; 5 library rect_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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 var r1 = createRectangle(test[1]); 67 var r1 = createRectangle(test[1]);
68 var expected = createRectangle(test[2]); 68 var expected = createRectangle(test[2]);
69 69
70 expect(r0.boundingBox(r1), expected); 70 expect(r0.boundingBox(r1), expected);
71 expect(r1.boundingBox(r0), expected); 71 expect(r1.boundingBox(r0), expected);
72 } 72 }
73 }); 73 });
74 74
75 test('containsRectangle', () { 75 test('containsRectangle', () {
76 var r = new Rectangle(-10, 0, 20, 10); 76 var r = new Rectangle(-10, 0, 20, 10);
77 expect(r.contains(r), isTrue); 77 expect(r.containsRectangle(r), isTrue);
78 78
79 expect(r.contains( 79 expect(r.containsRectangle(
80 new Rectangle(double.NAN, double.NAN, double.NAN, double.NAN)), isFalse) ; 80 new Rectangle(double.NAN, double.NAN, double.NAN, double.NAN)), isFalse) ;
81 81
82 var r2 = new Rectangle(0, 2, 5, 5); 82 var r2 = new Rectangle(0, 2, 5, 5);
83 expect(r.contains(r2), isTrue); 83 expect(r.containsRectangle(r2), isTrue);
84 expect(r2.contains(r), isFalse); 84 expect(r2.containsRectangle(r), isFalse);
85 85
86 r2 = new Rectangle(-11, 2, 5, 5); 86 r2 = new Rectangle(-11, 2, 5, 5);
87 expect(r.contains(r2), isFalse); 87 expect(r.containsRectangle(r2), isFalse);
88 r2 = new Rectangle(0, 2, 15, 5); 88 r2 = new Rectangle(0, 2, 15, 5);
89 expect(r.contains(r2), isFalse); 89 expect(r.containsRectangle(r2), isFalse);
90 r2 = new Rectangle(0, 2, 5, 10); 90 r2 = new Rectangle(0, 2, 5, 10);
91 expect(r.contains(r2), isFalse); 91 expect(r.containsRectangle(r2), isFalse);
92 r2 = new Rectangle(0, 0, 5, 10); 92 r2 = new Rectangle(0, 0, 5, 10);
93 expect(r.contains(r2), isTrue); 93 expect(r.containsRectangle(r2), isTrue);
94 }); 94 });
95 95
96 test('containsPoint', () { 96 test('containsPoint', () {
97 var r = new Rectangle(20, 40, 60, 80); 97 var r = new Rectangle(20, 40, 60, 80);
98 98
99 // Test middle. 99 // Test middle.
100 expect(r.containsPoint(new Point(50, 80)), isTrue); 100 expect(r.containsPoint(new Point(50, 80)), isTrue);
101 101
102 // Test edges. 102 // Test edges.
103 expect(r.containsPoint(new Point(20, 40)), isTrue); 103 expect(r.containsPoint(new Point(20, 40)), isTrue);
(...skipping 18 matching lines...) Expand all
122 122
123 test('hashCode', () { 123 test('hashCode', () {
124 var a = new Rectangle(0, 1, 2, 3); 124 var a = new Rectangle(0, 1, 2, 3);
125 var b = new Rectangle(0, 1, 2, 3); 125 var b = new Rectangle(0, 1, 2, 3);
126 expect(a.hashCode, b.hashCode); 126 expect(a.hashCode, b.hashCode);
127 127
128 var c = new Rectangle(1, 0, 2, 3); 128 var c = new Rectangle(1, 0, 2, 3);
129 expect(a.hashCode == c.hashCode, isFalse); 129 expect(a.hashCode == c.hashCode, isFalse);
130 }); 130 });
131 } 131 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698