| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.index.lru_cache; | 5 library test.index.lru_cache; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/index/lru_cache.dart'; | 7 import 'package:analysis_server/src/index/lru_cache.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import '../reflective_tests.dart'; | 10 import '../reflective_tests.dart'; |
| 11 | 11 |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 groupSep = ' | '; | 14 groupSep = ' | '; |
| 15 group('FixedStringCodecTest', () { | 15 group('LRUCache', () { |
| 16 runReflectiveTests(_LRUCacheTest); | 16 runReflectiveTests(_LRUCacheTest); |
| 17 }); | 17 }); |
| 18 } | 18 } |
| 19 | 19 |
| 20 | 20 |
| 21 @ReflectiveTestCase() | 21 @ReflectiveTestCase() |
| 22 class _LRUCacheTest { | 22 class _LRUCacheTest { |
| 23 LRUCache<int, String> cache = new LRUCache<int, String>(3); | 23 LRUCache<int, String> cache = new LRUCache<int, String>(3); |
| 24 | 24 |
| 25 void test_evict_notGet() { | 25 void test_evict_notGet() { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 cache.put(3, 'C'); | 90 cache.put(3, 'C'); |
| 91 // remove | 91 // remove |
| 92 cache.remove(1); | 92 cache.remove(1); |
| 93 cache.remove(3); | 93 cache.remove(3); |
| 94 // check | 94 // check |
| 95 expect(cache.get(1), isNull); | 95 expect(cache.get(1), isNull); |
| 96 expect(cache.get(2), 'B'); | 96 expect(cache.get(2), 'B'); |
| 97 expect(cache.get(3), isNull); | 97 expect(cache.get(3), isNull); |
| 98 } | 98 } |
| 99 } | 99 } |
| OLD | NEW |