OLD | NEW |
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:test/test.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 Rectangle createRectangle(List<num> a) { | 11 Rectangle createRectangle(List<num> a) { |
12 return a != null ? new Rectangle(a[0], a[1], a[2] - a[0], a[3] - a[1]) | 12 return a != null ? new Rectangle(a[0], a[1], a[2] - a[0], a[3] - a[1]) |
13 : null; | 13 : null; |
14 } | 14 } |
15 | 15 |
16 test('construction', () { | 16 test('construction', () { |
17 var r0 = new Rectangle(10, 20, 30, 40); | 17 var r0 = new Rectangle(10, 20, 30, 40); |
18 expect(r0.toString(), 'Rectangle (10, 20) 30 x 40'); | 18 expect(r0.toString(), 'Rectangle (10, 20) 30 x 40'); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 for (var r in rectangles) { | 241 for (var r in rectangles) { |
242 expect(r.containsPoint(new Point(0, 1)), false); | 242 expect(r.containsPoint(new Point(0, 1)), false); |
243 expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false); | 243 expect(r.containsRectangle(new Rectangle(0, 1, 2, 3)), false); |
244 expect(r.intersects(new Rectangle(0, 1, 2, 3)), false); | 244 expect(r.intersects(new Rectangle(0, 1, 2, 3)), false); |
245 expect(r.bottom, isNaN); | 245 expect(r.bottom, isNaN); |
246 expect(r.height, isNaN); | 246 expect(r.height, isNaN); |
247 } | 247 } |
248 }); | 248 }); |
249 } | 249 } |
250 | 250 |
OLD | NEW |