Extension type. Test for DartSelectionRangeComputer.

Change-Id: I5e88681dc901a900e5de7ccd13e0c05341c42456
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2023-09-01 21:48:09 +00:00 committed by Commit Queue
parent e268258df6
commit a7bb403125

View file

@ -99,6 +99,39 @@ final foo = Foo("^test");
);
}
Future<void> test_extensionType() async {
final content = TestCode.parse('''
extension type E<T>(int it) {
void void foo() {
(1 ^+ 2) * 3;
}
}
''');
final regions = await _computeSelectionRanges(content);
_expectRegions(
regions,
content,
[
'1 + 2',
'(1 + 2)',
'(1 + 2) * 3',
'(1 + 2) * 3;',
'{\n'
' (1 + 2) * 3;\n'
' }',
'void foo() {\n'
' (1 + 2) * 3;\n'
' }',
'extension type E<T>(int it) {\n'
' void void foo() {\n'
' (1 + 2) * 3;\n'
' }\n'
'}',
],
);
}
Future<void> test_field_recordType() async {
final content = TestCode.parse('''
class C<T> {