mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:16:51 +00:00
Add test for augmentations to Type Hierarchy legacy protocol
Change-Id: Ib76f9ec23b0d2270aef5c0b85b7ac72d8cc528e3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353580 Commit-Queue: Keerti Parthasarathy <keertip@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
7c223d8312
commit
233de26ab4
|
@ -81,6 +81,71 @@ class B extends A {
|
|||
]);
|
||||
}
|
||||
|
||||
Future<void> test_class_augmentation() async {
|
||||
addTestFile('''
|
||||
import augment 'a.dart';
|
||||
|
||||
class MyClass1 {}
|
||||
class C {}
|
||||
''');
|
||||
|
||||
newFile('$testPackageLibPath/a.dart', '''
|
||||
library augment 'test.dart';
|
||||
|
||||
augment class C extends MyClass1 {}
|
||||
''');
|
||||
var items = await _getTypeHierarchy('MyClass1 {}');
|
||||
expect(_toJson(items), [
|
||||
{
|
||||
'classElement': {
|
||||
'kind': 'CLASS',
|
||||
'name': 'MyClass1',
|
||||
'location': anything,
|
||||
'flags': 0
|
||||
},
|
||||
'superclass': 1,
|
||||
'interfaces': [],
|
||||
'mixins': [],
|
||||
'subclasses': [2, 3]
|
||||
},
|
||||
{
|
||||
'classElement': {
|
||||
'kind': 'CLASS',
|
||||
'name': 'Object',
|
||||
'location': anything,
|
||||
'flags': 0
|
||||
},
|
||||
'interfaces': [],
|
||||
'mixins': [],
|
||||
'subclasses': []
|
||||
},
|
||||
{
|
||||
'classElement': {
|
||||
'kind': 'CLASS',
|
||||
'name': 'C',
|
||||
'location': anything,
|
||||
'flags': 0
|
||||
},
|
||||
'superclass': 0,
|
||||
'interfaces': [],
|
||||
'mixins': [],
|
||||
'subclasses': []
|
||||
},
|
||||
{
|
||||
'classElement': {
|
||||
'kind': 'CLASS',
|
||||
'name': 'C',
|
||||
'location': anything,
|
||||
'flags': 0
|
||||
},
|
||||
'superclass': 0,
|
||||
'interfaces': [],
|
||||
'mixins': [],
|
||||
'subclasses': []
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
Future<void> test_class_displayName() async {
|
||||
addTestFile('''
|
||||
class A<T> {
|
||||
|
|
Loading…
Reference in a new issue