Rename FileResolverTestView.resolvedLibraries
Change-Id: I30431ce52368737c5e0fb3666d30117fb0e77f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207600
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/test/src/cider/fixes_test.dart b/pkg/analysis_server/test/src/cider/fixes_test.dart
index fa71e62..4e57e14 100644
--- a/pkg/analysis_server/test/src/cider/fixes_test.dart
+++ b/pkg/analysis_server/test/src/cider/fixes_test.dart
@@ -48,7 +48,7 @@
''');
// The file was resolved only once, even though we have 2 errors.
- expect(fileResolver.testView!.resolvedFiles, [convertPath(testPath)]);
+ expect(fileResolver.testView!.resolvedLibraries, [convertPath(testPath)]);
}
Future<void> test_createMethod() async {
diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
index aa4627e..d52742b 100644
--- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
+++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
@@ -507,7 +507,7 @@
);
});
- testView?.addResolvedFile(path);
+ testView?.addResolvedLibrary(path);
late Map<FileState, UnitAnalysisResult> results;
@@ -762,13 +762,13 @@
}
class FileResolverTestView {
- /// The paths of files which were resolved.
+ /// The paths of libraries which were resolved.
///
- /// The file path is added every time when it is resolved.
- final List<String> resolvedFiles = [];
+ /// The library path is added every time when it is resolved.
+ final List<String> resolvedLibraries = [];
- void addResolvedFile(String path) {
- resolvedFiles.add(path);
+ void addResolvedLibrary(String path) {
+ resolvedLibraries.add(path);
}
}
diff --git a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
index 0944438..6e07a14 100644
--- a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
+++ b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
@@ -673,34 +673,34 @@
var path = convertPath('/workspace/dart/test/lib/test.dart');
// No resolved files yet.
- expect(fileResolver.testView!.resolvedFiles, isEmpty);
+ expect(fileResolver.testView!.resolvedLibraries, isEmpty);
// No cached, will resolve once.
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// Has cached, will be not resolved again.
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// New resolver.
// Still has cached, will be not resolved.
createFileResolver();
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, <Object>[]);
+ expect(fileResolver.testView!.resolvedLibraries, <Object>[]);
// Change the file, new resolver.
// With changed file the previously cached result cannot be used.
addTestFile('var a = c;');
createFileResolver();
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// New resolver.
// Still has cached, will be not resolved.
createFileResolver();
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, <Object>[]);
+ expect(fileResolver.testView!.resolvedLibraries, <Object>[]);
}
test_getErrors_reuse_changeDependency() {
@@ -716,15 +716,15 @@
var path = convertPath('/workspace/dart/test/lib/test.dart');
// No resolved files yet.
- expect(fileResolver.testView!.resolvedFiles, isEmpty);
+ expect(fileResolver.testView!.resolvedLibraries, isEmpty);
// No cached, will resolve once.
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// Has cached, will be not resolved again.
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// Change the dependency, new resolver.
// The signature of the result is different.
@@ -734,13 +734,13 @@
''');
createFileResolver();
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, [path]);
+ expect(fileResolver.testView!.resolvedLibraries, [path]);
// New resolver.
// Still has cached, will be not resolved.
createFileResolver();
expect(getTestErrors().errors, hasLength(1));
- expect(fileResolver.testView!.resolvedFiles, <Object>[]);
+ expect(fileResolver.testView!.resolvedLibraries, <Object>[]);
}
test_getLibraryByUri() {
@@ -1060,20 +1060,20 @@
// No resolved files yet.
var testView = fileResolver.testView!;
- expect(testView.resolvedFiles, isEmpty);
+ expect(testView.resolvedLibraries, isEmpty);
await resolveFile2(path);
var result1 = result;
// The file was resolved.
- expect(testView.resolvedFiles, [path]);
+ expect(testView.resolvedLibraries, [path]);
// The result is cached.
expect(fileResolver.cachedResults, contains(path));
// Ask again, no changes, not resolved.
await resolveFile2(path);
- expect(testView.resolvedFiles, [path]);
+ expect(testView.resolvedLibraries, [path]);
// The same result was returned.
expect(result, same(result1));
@@ -1084,7 +1084,7 @@
// The was a change to a file, no matter which, resolve again.
await resolveFile2(path);
- expect(testView.resolvedFiles, [path, path]);
+ expect(testView.resolvedLibraries, [path, path]);
// Get should get a new result.
expect(result, isNot(same(result1)));
@@ -1103,7 +1103,7 @@
// No resolved files yet.
var testView = fileResolver.testView!;
- expect(testView.resolvedFiles, isEmpty);
+ expect(testView.resolvedLibraries, isEmpty);
fileResolver.resolve(
path: b_path,
@@ -1112,7 +1112,7 @@
);
// The file was resolved.
- expect(testView.resolvedFiles, [a_path]);
+ expect(testView.resolvedLibraries, [a_path]);
// The completion location was set, so not units are resolved.
// So, the result should not be cached.