Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Test properties of ports. | 5 // Test properties of ports. |
| 6 // Note: unittest.dart depends on ports, in particular on the behaviour tested | 6 // Note: unittest.dart depends on ports, in particular on the behaviour tested |
| 7 // here. To keep things simple, we don't use the unittest library here. | 7 // here. To keep things simple, we don't use the unittest library here. |
| 8 | 8 |
| 9 library PortTest; | 9 library PortTest; |
| 10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| 11 import 'dart:isolate'; | 11 import 'dart:isolate'; |
| 12 import '../../pkg/unittest/lib/matcher.dart'; | 12 import '../../pkg/matcher/lib/matcher.dart'; |
|
Siggi Cherem (dart-lang)
2014/03/31 17:13:34
seems like there is a package: above for expect, m
kevmoo
2014/03/31 18:33:01
Separate CL - https://codereview.chromium.org/2182
| |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 testHashCode(); | 15 testHashCode(); |
| 16 testEquals(); | 16 testEquals(); |
| 17 testMap(); | 17 testMap(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void testHashCode() { | 20 void testHashCode() { |
| 21 ReceivePort rp0 = new ReceivePort(); | 21 ReceivePort rp0 = new ReceivePort(); |
| 22 ReceivePort rp1 = new ReceivePort(); | 22 ReceivePort rp1 = new ReceivePort(); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 53 Expect.isFalse(map.containsKey(rp0.sendPort)); | 53 Expect.isFalse(map.containsKey(rp0.sendPort)); |
| 54 Expect.equals(map[rp1.sendPort], 87); | 54 Expect.equals(map[rp1.sendPort], 87); |
| 55 | 55 |
| 56 map.remove(rp1.sendPort); | 56 map.remove(rp1.sendPort); |
| 57 Expect.isFalse(map.containsKey(rp0.sendPort)); | 57 Expect.isFalse(map.containsKey(rp0.sendPort)); |
| 58 Expect.isFalse(map.containsKey(rp1.sendPort)); | 58 Expect.isFalse(map.containsKey(rp1.sendPort)); |
| 59 | 59 |
| 60 rp0.close(); | 60 rp0.close(); |
| 61 rp1.close(); | 61 rp1.close(); |
| 62 } | 62 } |
| OLD | NEW |