| Index: runtime/observatory/tests/service/address_mapper_test.dart
|
| diff --git a/runtime/observatory/tests/service/address_mapper_test.dart b/runtime/observatory/tests/service/address_mapper_test.dart
|
| index b0534932a072301e73fcd53d9566cfd46c499d6d..05fbf368437155504685ffa17a0a27568930c988 100644
|
| --- a/runtime/observatory/tests/service/address_mapper_test.dart
|
| +++ b/runtime/observatory/tests/service/address_mapper_test.dart
|
| @@ -4,27 +4,52 @@
|
| // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
|
|
|
| import 'package:observatory/object_graph.dart';
|
| -import 'package:expect/expect.dart';
|
| +import 'package:unittest/unittest.dart';
|
| +
|
| +dynamic confuse() {
|
| + if (true) {
|
| + return "5";
|
| + }
|
| + return 5;
|
| +}
|
|
|
| main() {
|
| var map = new AddressMapper(42);
|
|
|
| - Expect.equals(null, map.get(1, 2, 3));
|
| - Expect.equals(4, map.put(1, 2, 3, 4));
|
| - Expect.equals(4, map.get(1, 2, 3));
|
| + expect(map.get(1, 2, 3), isNull);
|
| + expect(map.put(1, 2, 3, 4), equals(4));
|
| + expect(map.get(1, 2, 3), equals(4));
|
|
|
| - Expect.equals(null, map.get(2, 3, 1));
|
| - Expect.equals(null, map.get(3, 1, 2));
|
| + expect(map.get(2, 3, 1), isNull);
|
| + expect(map.get(3, 1, 2), isNull);
|
|
|
| - Expect.throws(() => map.put(1, 2, 3, 44),
|
| - (e) => true,
|
| - "Overwrite key");
|
| + bool exceptionThrown = false;
|
| + try {
|
| + expect(exceptionThrown, isFalse);
|
| + map.put(1, 2, 3, 44);
|
| + expect(true, isFalse);
|
| + } catch (e) {
|
| + exceptionThrown = true;
|
| + }
|
| + expect(exceptionThrown, isTrue);
|
|
|
| - Expect.throws(() => map.put(5, 6, 7, 0),
|
| - (e) => true,
|
| - "Invalid value");
|
| + exceptionThrown = false;
|
| + try {
|
| + expect(exceptionThrown, isFalse);
|
| + map.put(5, 6, 7, 0);
|
| + expect(true, isFalse);
|
| + } catch (e) {
|
| + exceptionThrown = true;
|
| + }
|
| + expect(exceptionThrown, isTrue);
|
|
|
| - Expect.throws(() => map.put("5", 6, 7, 0),
|
| - (e) => true,
|
| - "Invalid key");
|
| + exceptionThrown = false;
|
| + try {
|
| + expect(exceptionThrown, isFalse);
|
| + map.put(confuse(), 6, 7, 0);
|
| + expect(true, isFalse);
|
| + } catch (e) {
|
| + exceptionThrown = true;
|
| + }
|
| + expect(exceptionThrown, isTrue);
|
| }
|
|
|