mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
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:
parent
e268258df6
commit
a7bb403125
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue