Skip to content

Commit

Permalink
[wildcards] implementation marker tests
Browse files Browse the repository at this point in the history
See: #55681

Change-Id: I29afe39dd293e2e9da67791ad92f3d6d8356493e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381807
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
pq authored and Commit Queue committed Aug 23, 2024
1 parent 63ccfe8 commit 4f4ba74
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkg/analysis_server/test/lsp/implementation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class ImplementationTest extends AbstractLspAnalysisServerTest {
class /*[1*/C/*1]*/ extends A {}
''');

Future<void> test_class_sub_underscore() => _testMarkedContent('''
abstract class ^_ {}
class /*[0*/B/*0]*/ extends _ {}
class /*[1*/C/*1]*/ extends _ {}
''');

Future<void> test_class_subSub() => _testMarkedContent('''
abstract class ^A {}
class /*[0*/B/*0]*/ extends A {}
Expand Down Expand Up @@ -68,6 +74,17 @@ class ImplementationTest extends AbstractLspAnalysisServerTest {
}
''');

Future<void> test_getter_overriddenByField_underscore() =>
_testMarkedContent('''
class B extends A {
final String? [!_!] = null;
}
abstract class A {
String? get _^;
}
''');

Future<void> test_method_excludesClassesWithoutImplementations() =>
_testMarkedContent('''
abstract class A {
Expand Down Expand Up @@ -162,6 +179,20 @@ class ImplementationTest extends AbstractLspAnalysisServerTest {
}
''');

Future<void> test_method_sub_underscore() => _testMarkedContent('''
abstract class A {
void ^_();
}
class B extends A {
void /*[0*/_/*0]*/() {}
}
class C extends A {
void /*[1*/_/*1]*/() {}
}
''');

Future<void> test_method_subSub() => _testMarkedContent('''
abstract class A {
void ^b();
Expand Down

0 comments on commit 4f4ba74

Please sign in to comment.