Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: pkg/analysis_server/test/protocol_server_test.dart

Issue 848943002: fix function type alias conversion to protocol element (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/protocol_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « pkg/analysis_server/lib/src/protocol_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698