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

Unified Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 10834061: Resolve typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated scope handling and type resolution Created 8 years, 5 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
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 96aa7e899d8c2594c49e8a1dd0075b41f72c81a9..398c4780d21d20e0fd5826ca4ea16e627b371ac7 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -256,6 +256,35 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(bazClass.isInterface, "Class is interface");
Expect.isFalse(bazClass.isPrivate, "Class is private");
+ var bazClassTypeVariables = bazClass.typeVariables();
+ Expect.isNotNull(bazClassTypeVariables, "Type variable list is null");
+ Expect.equals(2, bazClassTypeVariables.length,
+ "Type variable list is not empty");
+
+ var bazE = bazClassTypeVariables[0];
+ Expect.isNotNull(bazE, "Type variable is null");
+ Expect.stringEquals('E', bazE.simpleName(), "Unexpected simpleName");
+ Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName(),
+ "Unexpected qualifiedName");
+ Expect.equals(bazClass, bazE.declarer(),
+ "Unexpected type variable declarer");
+ var bazEbound = bazE.bound();
+ Expect.isNotNull(bazEbound, "Missing type variable bound");
+ Expect.isFalse(bazEbound.isDeclaration, "Bound is declaration");
+ Expect.isTrue(bazEbound.isObject, "Bound is not object");
+
+ var bazF = bazClassTypeVariables[1];
+ Expect.isNotNull(bazF, "Type variable is null");
+ Expect.stringEquals('F', bazF.simpleName(), "Unexpected simpleName");
+ Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName(),
+ "Unexpected qualifiedName");
+ Expect.equals(bazClass, bazF.declarer());
+ var bazFbound = bazF.bound();
+ Expect.isNotNull(bazFbound, "Missing type variable bound");
+ Expect.isFalse(bazFbound.isDeclaration, "Bound is declaration");
+ Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName(),
+ "Bound is not Foo");
+
var objectType = bazClass.superclass();
Expect.isNotNull(objectType, "Superclass is null");
Expect.isTrue(objectType.isObject, "Object is not Object");
@@ -281,42 +310,14 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(barInterface.isDeclaration, "Interface type is declaration");
var barInterfaceTypeArguments = barInterface.typeArguments();
Expect.isNotNull(barInterfaceTypeArguments, "Type arguments are missing");
- // TODO(johnniwinther): Ensure type arguments on supertypes. Expected result
- // should have been 1:
- Expect.equals(0, barInterfaceTypeArguments.length,
+ Expect.equals(1, barInterfaceTypeArguments.length,
"Type arguments is empty");
+ Expect.equals(bazE, barInterfaceTypeArguments[0],
+ "Unexpected type argument on super type");
Expect.throws(() => bazClass.typeArguments(),
(exception) => true,
"Class has type arguments");
- var bazClassTypeVariables = bazClass.typeVariables();
- Expect.isNotNull(bazClassTypeVariables, "Type variable list is null");
- Expect.equals(2, bazClassTypeVariables.length,
- "Type variable list is not empty");
-
- var bazE = bazClassTypeVariables[0];
- Expect.isNotNull(bazE, "Type variable is null");
- Expect.stringEquals('E', bazE.simpleName(), "Unexpected simpleName");
- Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName(),
- "Unexpected qualifiedName");
- Expect.equals(bazClass, bazE.declarer(),
- "Unexpected type variable declarer");
- var bazEbound = bazE.bound();
- Expect.isNotNull(bazEbound, "Missing type variable bound");
- Expect.isFalse(bazEbound.isDeclaration, "Bound is declaration");
- Expect.isTrue(bazEbound.isObject, "Bound is not object");
-
- var bazF = bazClassTypeVariables[1];
- Expect.isNotNull(bazF, "Type variable is null");
- Expect.stringEquals('F', bazF.simpleName(), "Unexpected simpleName");
- Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName(),
- "Unexpected qualifiedName");
- Expect.equals(bazClass, bazF.declarer());
- var bazFbound = bazF.bound();
- Expect.isNotNull(bazFbound, "Missing type variable bound");
- Expect.isFalse(bazFbound.isDeclaration, "Bound is declaration");
- Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName(),
- "Bound is not Foo");
Expect.isNull(bazClass.defaultType(), "Class has default type");

Powered by Google App Engine
This is Rietveld 408576698