OLD | NEW |
(Empty) | |
| 1 import 'package:unittest/unittest.dart'; |
| 2 import 'dart:math' show Point; |
| 3 |
| 4 main() { |
| 5 Point a = new Point(2, 15); |
| 6 Point b = new Point(7, 3); |
| 7 |
| 8 test('point distances', () { |
| 9 expect(a.distanceTo(b), equals(13)); |
| 10 }); |
| 11 test('point magnitude close to', () { |
| 12 expect(a.magnitude, closeTo(15, .25)); |
| 13 }); |
| 14 test('point magnitude greater than', () { |
| 15 expect(a.magnitude, greaterThan(b.magnitude)); |
| 16 }); |
| 17 test('point == operator', () { |
| 18 expect(a == b, equals(false)); |
| 19 }); |
| 20 } |
OLD | NEW |