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 final m1 = const { 'a': 400 + 99 }; | 5 const m1 = const { 'a': 400 + 99 }; |
6 final m2 = const { 'a': 499, 'b': 42 }; | 6 const m2 = const { 'a': 499, 'b': 42 }; |
7 final m3 = const { 'm1': m1, 'm2': m2 }; | 7 const m3 = const { 'm1': m1, 'm2': m2 }; |
8 final m4 = const { 'z': 9, 'a': 8, 'm': 7 }; | 8 const m4 = const { 'z': 9, 'a': 8, 'm': 7 }; |
9 final m5 = const { '': 499 }; | 9 const m5 = const { '': 499 }; |
10 final m6 = const { 'a': 499 }; | 10 const m6 = const { 'a': 499 }; |
11 final m7 = const {}; | 11 const m7 = const {}; |
12 | 12 |
13 bool isIllegalAccessException(o) => o is IllegalAccessException; | 13 bool isIllegalAccessException(o) => o is IllegalAccessException; |
14 | 14 |
15 main() { | 15 main() { |
16 Expect.equals(499, m1['a']); | 16 Expect.equals(499, m1['a']); |
17 Expect.equals(null, m1['b']); | 17 Expect.equals(null, m1['b']); |
18 Expect.listEquals(['a'], m1.getKeys()); | 18 Expect.listEquals(['a'], m1.getKeys()); |
19 Expect.listEquals([499], m1.getValues()); | 19 Expect.listEquals([499], m1.getValues()); |
20 Expect.isTrue(m1.containsKey('a')); | 20 Expect.isTrue(m1.containsKey('a')); |
21 Expect.isFalse(m1.containsKey('toString')); | 21 Expect.isFalse(m1.containsKey('toString')); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 Expect.throws(() => m7.remove('a'), isIllegalAccessException); | 117 Expect.throws(() => m7.remove('a'), isIllegalAccessException); |
118 Expect.throws(() => m7.remove('b'), isIllegalAccessException); | 118 Expect.throws(() => m7.remove('b'), isIllegalAccessException); |
119 Expect.throws(() => m7.clear(), isIllegalAccessException); | 119 Expect.throws(() => m7.clear(), isIllegalAccessException); |
120 Expect.throws(() => m7['b'] = 42, isIllegalAccessException); | 120 Expect.throws(() => m7['b'] = 42, isIllegalAccessException); |
121 Expect.throws(() => m7['a'] = 499, isIllegalAccessException); | 121 Expect.throws(() => m7['a'] = 499, isIllegalAccessException); |
122 Expect.throws(() => m7.putIfAbsent('a', () => 499), | 122 Expect.throws(() => m7.putIfAbsent('a', () => 499), |
123 isIllegalAccessException); | 123 isIllegalAccessException); |
124 Expect.throws(() => m7.putIfAbsent('z', () => 499), | 124 Expect.throws(() => m7.putIfAbsent('z', () => 499), |
125 isIllegalAccessException); | 125 isIllegalAccessException); |
126 } | 126 } |
OLD | NEW |