Chromium Code Reviews| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 expect(b.round(), new Point(5, 10)); | 96 expect(b.round(), new Point(5, 10)); |
| 97 }); | 97 }); |
| 98 | 98 |
| 99 test('toInt', () { | 99 test('toInt', () { |
| 100 var a = new Point(5.1, 10.8); | 100 var a = new Point(5.1, 10.8); |
| 101 var b = a.toInt(); | 101 var b = a.toInt(); |
| 102 expect(b, new Point(5, 10)); | 102 expect(b, new Point(5, 10)); |
| 103 expect(b.x is int, isTrue); | 103 expect(b.x is int, isTrue); |
| 104 expect(b.y is int, isTrue); | 104 expect(b.y is int, isTrue); |
| 105 }); | 105 }); |
| 106 | |
| 107 test('hashCode', () { | |
| 108 var a = new Point(0, 1); | |
| 109 var b = new Point(0, 1); | |
| 110 expect(a.hashCode, b.hashCode); | |
| 111 | |
| 112 var c = new Point(1, 1); | |
|
sra1
2013/06/28 22:25:02
A fun test is that (0,1) and (1,0) differ.
blois
2013/06/28 22:35:37
Done.
| |
| 113 expect(a.hashCode == c.hashCode, isFalse); | |
| 114 }); | |
| 106 } | 115 } |
| OLD | NEW |