Skip to content

Commit

Permalink
[wildcards] Call Hierarchy target tests
Browse files Browse the repository at this point in the history
See: #55681

Change-Id: I80d37209fb69bfcacdec3bec943d75019e17966d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
  • Loading branch information
pq authored and Commit Queue committed Jul 17, 2024
1 parent 37e351d commit 5995cf6
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,52 @@ void f() {
Future<void> test_whitespace() async {
await expectNoTarget(TestCode.parse(' ^ void f() {}'));
}

Future<void> test_wildcardVariable() async {
var code = TestCode.parse('''
f() {
[!^_() {}!]
}
''');

var target = await findTarget(code);
expect(
target,
_isItem(
CallHierarchyKind.function,
'_',
testFile.path,
containerName: 'f',
nameRange: SourceRange(8, 1),
codeRange: code.range.sourceRange,
),
);
}

Future<void> test_wildcardVariable_preWildcards() async {
var code = TestCode.parse('''
// @dart = 3.4
// (pre wildcard-variables)
f() {
[!_() {}!]
^_();
}
''');

var target = await findTarget(code);
expect(
target,
_isItem(
CallHierarchyKind.function,
'_',
testFile.path,
containerName: 'f',
nameRange: SourceRange(52, 1),
codeRange: code.range.sourceRange,
),
);
}
}

@reflectiveTest
Expand Down

0 comments on commit 5995cf6

Please sign in to comment.