OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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 library analyzer.test.src.util.lru_map_test; | 5 library analyzer.test.src.util.lru_map_test; |
6 | 6 |
7 import 'package:analyzer/src/util/lru_map.dart'; | 7 import 'package:analyzer/src/util/lru_map.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
10 | 10 |
11 import '../../utils.dart'; | |
12 | |
13 main() { | 11 main() { |
14 initializeTestEnvironment(); | |
15 defineReflectiveSuite(() { | 12 defineReflectiveSuite(() { |
16 defineReflectiveTests(_LRUCacheTest); | 13 defineReflectiveTests(_LRUCacheTest); |
17 }); | 14 }); |
18 } | 15 } |
19 | 16 |
20 @reflectiveTest | 17 @reflectiveTest |
21 class _LRUCacheTest { | 18 class _LRUCacheTest { |
22 LRUMap<int, String> cache = new LRUMap<int, String>(3); | 19 LRUMap<int, String> cache = new LRUMap<int, String>(3); |
23 | 20 |
24 void test_evict_notGet() { | 21 void test_evict_notGet() { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 cache.put(3, 'C'); | 86 cache.put(3, 'C'); |
90 // remove | 87 // remove |
91 cache.remove(1); | 88 cache.remove(1); |
92 cache.remove(3); | 89 cache.remove(3); |
93 // check | 90 // check |
94 expect(cache.get(1), isNull); | 91 expect(cache.get(1), isNull); |
95 expect(cache.get(2), 'B'); | 92 expect(cache.get(2), 'B'); |
96 expect(cache.get(3), isNull); | 93 expect(cache.get(3), isNull); |
97 } | 94 } |
98 } | 95 } |
OLD | NEW |