Skip to content

Commit a1b4f29

Browse files
scheglovCommit Queue
authored and
Commit Queue
committed
CQ. Use 'File' for resolveFile() and assertErrorsInFile2()
Replaced a few local helpers with pre-existing global ones. Change-Id: I40e2955ae353bf0ef7f21388b1f4b06bd08069a7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352051 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 2f90c9c commit a1b4f29

17 files changed

+457
-537
lines changed

pkg/analyzer/test/generated/non_hint_code_test.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,8 @@ import 'package:somepackage/other.dart';
187187

188188
Future<void> _assertErrorsInCodeInFile(
189189
String path, String content, List<ExpectedError> expectedErrors) async {
190-
path = convertPath(path);
191-
newFile(path, content);
192-
result = await resolveFile(path);
190+
var file = newFile(path, content);
191+
result = await resolveFile(file);
193192

194193
var errorListener = GatheringErrorListener();
195194
errorListener.addAll(result.errors);

pkg/analyzer/test/src/dart/ast/element_locator_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ part 'test.dart';
356356
part of my.lib;
357357
''');
358358

359-
await resolveFile(libFile.path);
359+
await resolveFile(libFile);
360360

361361
await resolveFile2(partFile);
362362
var node = findNode.partOf('part of');

pkg/analyzer/test/src/dart/micro/file_resolution.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ class FileResolutionTest with ResourceProviderMixin, ResolutionTest {
118118

119119
@override
120120
Future<ResolvedUnitResult> resolveFile(
121-
String path, {
121+
File file, {
122122
OperationPerformanceImpl? performance,
123123
}) async {
124124
result = await fileResolver.resolve(
125-
path: path,
125+
path: file.path,
126126
performance: performance,
127127
);
128128
return result;
129129
}
130130

131131
@override
132132
Future<void> resolveTestFile() async {
133-
result = await resolveFile(testFile.path);
133+
result = await resolveFile(testFile);
134134
findNode = FindNode(result.content, result.unit);
135135
findElement = FindElement(result.unit);
136136
}

0 commit comments

Comments
 (0)