| Index: tests/lib/mirrors/class_mirror_type_variables_test.dart
|
| diff --git a/tests/lib/mirrors/class_mirror_type_variables_test.dart b/tests/lib/mirrors/class_mirror_type_variables_test.dart
|
| index ee7baf95b8def14d0b03a87d9c43dd527904cea4..2a3ea7ef7a47a2d250029d27b0d313f91c3bcfb4 100644
|
| --- a/tests/lib/mirrors/class_mirror_type_variables_test.dart
|
| +++ b/tests/lib/mirrors/class_mirror_type_variables_test.dart
|
| @@ -6,15 +6,44 @@ import "dart:mirrors";
|
|
|
| import "package:expect/expect.dart";
|
|
|
| +class NoTypeParams {}
|
| +class A<T, S extends String> {}
|
| +class B<Z extends B<Z>> {}
|
| class C<R,S,T> {
|
| R foo(R r) => r;
|
| S bar(S s) => s;
|
| T baz(T t) => t;
|
| }
|
|
|
| -class NoTypeParams {}
|
| +testNoTypeParams() {
|
| + ClassMirror cm = reflectClass(NoTypeParams);
|
| + Expect.equals(cm.typeVariables.length, 0);
|
| +}
|
|
|
| -main() {
|
| +void testA() {
|
| + ClassMirror a = reflectClass(A);
|
| + Expect.equals(2, a.typeVariables.length);
|
| +
|
| + TypeVariableMirror aT = a.typeVariables[0];
|
| + TypeVariableMirror aS = a.typeVariables[1];
|
| + TypeMirror aTBound = aT.upperBound.originalDeclaration;
|
| + TypeMirror aSBound = aS.upperBound.originalDeclaration;
|
| +
|
| + Expect.equals(reflectClass(Object), aTBound);
|
| + Expect.equals(reflectClass(String), aSBound);
|
| +}
|
| +
|
| +void testB() {
|
| + ClassMirror b = reflectClass(B);
|
| + Expect.equals(1, b.typeVariables.length);
|
| +
|
| + TypeVariableMirror bZ = b.typeVariables[0];
|
| + ClassMirror bZBound = bZ.upperBound.originalDeclaration;
|
| + Expect.equals(b, bZBound);
|
| + Expect.equals(bZ, bZBound.typeVariables[0]);
|
| +}
|
| +
|
| +testC() {
|
| ClassMirror cm;
|
| cm = reflectClass(C);
|
| Expect.equals(3, cm.typeVariables.length);
|
| @@ -25,6 +54,11 @@ main() {
|
| Expect.equals(#R, values.elementAt(0).simpleName);
|
| Expect.equals(#S, values.elementAt(1).simpleName);
|
| Expect.equals(#T, values.elementAt(2).simpleName);
|
| - cm = reflectClass(NoTypeParams);
|
| - Expect.equals(cm.typeVariables.length, 0);
|
| }
|
| +
|
| +main() {
|
| + testNoTypeParams();
|
| + testA();
|
| + testB();
|
| + testC();
|
| +}
|
|
|