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

Unified Diff: pkg/front_end/test/src/base/file_repository_test.dart

Issue 2644953002: Store a file state in the incremental resolved AST generator. (Closed)
Patch Set: Additional testing logic 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/front_end/test/incremental_resolved_ast_generator_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/src/base/file_repository_test.dart
diff --git a/pkg/front_end/test/src/base/file_repository_test.dart b/pkg/front_end/test/src/base/file_repository_test.dart
index de033b093a55640d78582f09841739ef9d5b43aa..f911ba3443d2f233ae45bb455b85732ae63501fa 100644
--- a/pkg/front_end/test/src/base/file_repository_test.dart
+++ b/pkg/front_end/test/src/base/file_repository_test.dart
@@ -2,15 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/error/listener.dart';
-import 'package:analyzer/src/generated/parser.dart';
-import 'package:analyzer/src/summary/summarize_ast.dart';
import 'package:front_end/src/base/file_repository.dart';
-import 'package:front_end/src/base/library_info.dart';
-import 'package:front_end/src/libraries_reader.dart';
-import 'package:front_end/src/scanner/errors.dart';
-import 'package:front_end/src/scanner/reader.dart';
-import 'package:front_end/src/scanner/scanner.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -26,6 +18,14 @@ main() {
class FileRepositoryTest {
final fileRepository = new FileRepository();
+ test_clearContents() {
+ var uri = Uri.parse('file:///foo/bar.dart');
+ fileRepository.store(uri, 'contents1');
+ expect(fileRepository.getContentsForTesting(), isNotEmpty);
+ fileRepository.clearContents();
+ expect(fileRepository.getContentsForTesting(), isEmpty);
+ }
+
test_contentsForPath() {
var path1 =
fileRepository.store(Uri.parse('file:///foo/bar.dart'), 'contents1');
@@ -49,8 +49,10 @@ class FileRepositoryTest {
var path = fileRepository.store(uri, 'contents1');
expect(path, endsWith('.dart'));
expect(fileRepository.contentsForPath(path), 'contents1');
+ expect(fileRepository.getContentsForTesting(), {path: 'contents1'});
expect(fileRepository.store(uri, 'contents2'), path);
expect(fileRepository.contentsForPath(path), 'contents2');
+ expect(fileRepository.getContentsForTesting(), {path: 'contents2'});
}
test_uriForPath() {
« no previous file with comments | « pkg/front_end/test/incremental_resolved_ast_generator_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698