OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override |
| 5 |
| 6 import 'package:observatory/object_graph.dart'; |
| 7 import 'package:expect/expect.dart'; |
| 8 |
| 9 main() { |
| 10 var map = new AddressMapper(42); |
| 11 |
| 12 Expect.equals(null, map.get(1, 2, 3)); |
| 13 Expect.equals(4, map.put(1, 2, 3, 4)); |
| 14 Expect.equals(4, map.get(1, 2, 3)); |
| 15 |
| 16 Expect.equals(null, map.get(2, 3, 1)); |
| 17 Expect.equals(null, map.get(3, 1, 2)); |
| 18 |
| 19 Expect.throws(() => map.put(1, 2, 3, 44), |
| 20 (e) => true, |
| 21 "Overwrite key"); |
| 22 |
| 23 Expect.throws(() => map.put(5, 6, 7, 0), |
| 24 (e) => true, |
| 25 "Invalid value"); |
| 26 |
| 27 Expect.throws(() => map.put("5", 6, 7, 0), |
| 28 (e) => true, |
| 29 "Invalid key"); |
| 30 } |
OLD | NEW |