| Index: pkg/analysis_server/test/protocol_server_test.dart
|
| diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
|
| index 0491b7c332793a7ab05b6ce982573fa63df6ff7d..f806f50d7d6192217d9f2be2bc450f00e3260736 100644
|
| --- a/pkg/analysis_server/test/protocol_server_test.dart
|
| +++ b/pkg/analysis_server/test/protocol_server_test.dart
|
| @@ -308,6 +308,29 @@ class A {
|
| expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
|
| }
|
|
|
| + void test_fromElement_FUNCTION_TYPE_ALIAS() {
|
| + engine.Source source = addSource('/test.dart', '''
|
| +typedef int f(String x);
|
| +''');
|
| + engine.CompilationUnit unit = resolveLibraryUnit(source);
|
| + engine.FunctionTypeAliasElement engineElement = findElementInUnit(unit, 'f');
|
| + // create notification Element
|
| + Element element = newElement_fromEngine(engineElement);
|
| + expect(element.kind, ElementKind.FUNCTION_TYPE_ALIAS);
|
| + expect(element.name, 'f');
|
| + {
|
| + Location location = element.location;
|
| + expect(location.file, '/test.dart');
|
| + expect(location.offset, 12);
|
| + expect(location.length, 'f'.length);
|
| + expect(location.startLine, 1);
|
| + expect(location.startColumn, 13);
|
| + }
|
| + expect(element.parameters, '(String x)');
|
| + expect(element.returnType, 'int');
|
| + expect(element.flags, 0);
|
| + }
|
| +
|
| void test_fromElement_GETTER() {
|
| engine.Source source = addSource('/test.dart', '''
|
| class A {
|
|
|