Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: pkg/analyzer/test/src/dart/analysis/byte_store_test.dart

Issue 2653203005: Add NullByteStore, that does not store any data. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/byte_store.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart b/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
index 9da3f0b6a9ebba19c30f059bd1b0e5b36cf29115..484a99fe10773105554a8e7af32d4fd1e217d661 100644
--- a/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/byte_store_test.dart
@@ -10,9 +10,14 @@ import 'package:typed_mock/typed_mock.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(MemoryCachingByteStoreTest);
+ defineReflectiveTests(NullByteStoreTest);
});
}
+List<int> _b(int length) {
Brian Wilkerson 2017/01/26 14:51:18 This is only used in one place. Please consider in
+ return new List<int>(length);
+}
+
@reflectiveTest
class MemoryCachingByteStoreTest {
test_get_notFound_evict() {
@@ -99,9 +104,17 @@ class MemoryCachingByteStoreTest {
expect(cachingStore.get('2'), isNull);
expect(cachingStore.get('3'), hasLength(30));
}
+}
+
+@reflectiveTest
+class NullByteStoreTest {
+ test_get() {
+ var store = new NullByteStore();
+
+ expect(store.get('1'), isNull);
- static List<int> _b(int length) {
- return new List<int>(length);
+ store.put('1', _b(10));
+ expect(store.get('1'), isNull);
}
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/byte_store.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698