Skip to content

Commit

Permalink
CQ. Use 'File' for resolveFile() and assertErrorsInFile2()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
scheglov authored and Commit Queue committed Feb 12, 2024
1 parent 2f90c9c commit a1b4f29
Show file tree
Hide file tree
Showing 17 changed files with 457 additions and 537 deletions.
5 changes: 2 additions & 3 deletions pkg/analyzer/test/generated/non_hint_code_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ import 'package:somepackage/other.dart';

Future<void> _assertErrorsInCodeInFile(
String path, String content, List<ExpectedError> expectedErrors) async {
path = convertPath(path);
newFile(path, content);
result = await resolveFile(path);
var file = newFile(path, content);
result = await resolveFile(file);

var errorListener = GatheringErrorListener();
errorListener.addAll(result.errors);
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/test/src/dart/ast/element_locator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ part 'test.dart';
part of my.lib;
''');

await resolveFile(libFile.path);
await resolveFile(libFile);

await resolveFile2(partFile);
var node = findNode.partOf('part of');
Expand Down
6 changes: 3 additions & 3 deletions pkg/analyzer/test/src/dart/micro/file_resolution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ class FileResolutionTest with ResourceProviderMixin, ResolutionTest {

@override
Future<ResolvedUnitResult> resolveFile(
String path, {
File file, {
OperationPerformanceImpl? performance,
}) async {
result = await fileResolver.resolve(
path: path,
path: file.path,
performance: performance,
);
return result;
}

@override
Future<void> resolveTestFile() async {
result = await resolveFile(testFile.path);
result = await resolveFile(testFile);
findNode = FindNode(result.content, result.unit);
findElement = FindElement(result.unit);
}
Expand Down
Loading

0 comments on commit a1b4f29

Please sign in to comment.