| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart test program for testing serialization of messages without spawning | 5 // Dart test program for testing serialization of messages without spawning |
| 6 // isolates. | 6 // isolates. |
| 7 | 7 |
| 8 // --------------------------------------------------------------------------- | 8 // --------------------------------------------------------------------------- |
| 9 // Serialization test. | 9 // Serialization test. |
| 10 // --------------------------------------------------------------------------- | 10 // --------------------------------------------------------------------------- |
| 11 library SerializationTest; | 11 library SerializationTest; |
| 12 import "package:expect/expect.dart"; | |
| 13 import 'dart:isolate'; | 12 import 'dart:isolate'; |
| 14 | 13 |
| 15 main() { | 14 main() { |
| 16 // TODO(sigmund): fix once we can disable privacy for testing (bug #1882) | 15 // TODO(sigmund): fix once we can disable privacy for testing (bug #1882) |
| 17 testAllTypes(TestingOnly.copy); | 16 testAllTypes(TestingOnly.copy); |
| 18 testAllTypes(TestingOnly.serialize); | 17 testAllTypes(TestingOnly.serialize); |
| 19 } | 18 } |
| 20 | 19 |
| 21 void testAllTypes(Function f) { | 20 void testAllTypes(Function f) { |
| 22 copyAndVerify(0, f); | 21 copyAndVerify(0, f); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 Expect.isTrue(copy is Map); | 68 Expect.isTrue(copy is Map); |
| 70 Expect.equals(o.length, copy.length); | 69 Expect.equals(o.length, copy.length); |
| 71 o.forEach((key, value) { | 70 o.forEach((key, value) { |
| 72 Expect.isTrue(copy.containsKey(key)); | 71 Expect.isTrue(copy.containsKey(key)); |
| 73 verify(value, copy[key]); | 72 verify(value, copy[key]); |
| 74 }); | 73 }); |
| 75 } else { | 74 } else { |
| 76 Expect.fail("Unexpected object encountered"); | 75 Expect.fail("Unexpected object encountered"); |
| 77 } | 76 } |
| 78 } | 77 } |
| OLD | NEW |