| 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 point_test; | 5 library point_test; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import '../../pkg/unittest/lib/unittest.dart'; | 8 import '../../pkg/unittest/lib/unittest.dart'; |
| 9 import '../../pkg/unittest/lib/html_config.dart'; | 9 import '../../pkg/unittest/lib/html_config.dart'; |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 }); | 105 }); |
| 106 | 106 |
| 107 test('hashCode', () { | 107 test('hashCode', () { |
| 108 var a = new Point(0, 1); | 108 var a = new Point(0, 1); |
| 109 var b = new Point(0, 1); | 109 var b = new Point(0, 1); |
| 110 expect(a.hashCode, b.hashCode); | 110 expect(a.hashCode, b.hashCode); |
| 111 | 111 |
| 112 var c = new Point(1, 0); | 112 var c = new Point(1, 0); |
| 113 expect(a.hashCode == c.hashCode, isFalse); | 113 expect(a.hashCode == c.hashCode, isFalse); |
| 114 }); | 114 }); |
| 115 |
| 116 test('magnitute', () { |
| 117 var a = new Point(5, 10); |
| 118 var b = new Point(0, 0); |
| 119 expect(a.magnitude, a.distanceTo(b)); |
| 120 expect(b.magnitude, 0); |
| 121 |
| 122 var c = new Point(-5, -10); |
| 123 expect(c.magnitude, a.distanceTo(b)); |
| 124 }); |
| 115 } | 125 } |
| OLD | NEW |