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

Unified Diff: tests/lib/mirrors/generic_function_typedef_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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/lib/mirrors/generic_function_typedef_test.dart
diff --git a/tests/lib/mirrors/generic_function_typedef_test.dart b/tests/lib/mirrors/generic_function_typedef_test.dart
index 295d3733a604ad052e44e422a188f6c43c12fee7..e30ac2845d42b08a6c3292ea5c65d1848969e3e9 100644
--- a/tests/lib/mirrors/generic_function_typedef_test.dart
+++ b/tests/lib/mirrors/generic_function_typedef_test.dart
@@ -26,13 +26,21 @@ reflectTypeDeclaration(t) => reflectType(t).originalDeclaration;
main() {
TypeMirror dynamicMirror = currentMirrorSystem().dynamicType;
- TypedefMirror predicateOfNum = (reflectClass(C).declarations[#predicateOfNum] as VariableMirror).type;
- TypedefMirror transformOfString = (reflectClass(C).declarations[#transformOfString] as VariableMirror).type;
- TypedefMirror transformOfR = (reflectClass(C).declarations[#transformOfR] as VariableMirror).type;
- TypedefMirror transformOfDouble = (reflect(new C<double>()).type.declarations[#transformOfR] as VariableMirror).type;
-
- TypeVariableMirror tFromGenericPredicate = reflectTypeDeclaration(GenericPredicate).typeVariables[0];
- TypeVariableMirror sFromGenericTransform = reflectTypeDeclaration(GenericTransform).typeVariables[0];
+ TypedefMirror predicateOfNum =
+ (reflectClass(C).declarations[#predicateOfNum] as VariableMirror).type;
+ TypedefMirror transformOfString =
+ (reflectClass(C).declarations[#transformOfString] as VariableMirror).type;
+ TypedefMirror transformOfR =
+ (reflectClass(C).declarations[#transformOfR] as VariableMirror).type;
+ TypedefMirror transformOfDouble = (reflect(new C<double>())
+ .type
+ .declarations[#transformOfR] as VariableMirror)
+ .type;
+
+ TypeVariableMirror tFromGenericPredicate =
+ reflectTypeDeclaration(GenericPredicate).typeVariables[0];
+ TypeVariableMirror sFromGenericTransform =
+ reflectTypeDeclaration(GenericTransform).typeVariables[0];
TypeVariableMirror rFromC = reflectClass(C).typeVariables[0];
// Typedefs.
@@ -52,13 +60,14 @@ main() {
typeArguments(transformOfR, [rFromC]);
typeArguments(transformOfDouble, [reflectClass(double)]);
- Expect.isTrue(reflectTypeDeclaration(NonGenericPredicate).isOriginalDeclaration);
+ Expect.isTrue(
+ reflectTypeDeclaration(NonGenericPredicate).isOriginalDeclaration);
Expect.isTrue(reflectTypeDeclaration(GenericPredicate).isOriginalDeclaration);
- Expect.isTrue(reflectTypeDeclaration(GenericTransform).isOriginalDeclaration);
- Expect.isFalse(predicateOfNum.isOriginalDeclaration);
- Expect.isFalse(transformOfString.isOriginalDeclaration);
- Expect.isFalse(transformOfR.isOriginalDeclaration);
- Expect.isFalse(transformOfDouble.isOriginalDeclaration);
+ Expect.isTrue(reflectTypeDeclaration(GenericTransform).isOriginalDeclaration);
+ Expect.isFalse(predicateOfNum.isOriginalDeclaration);
+ Expect.isFalse(transformOfString.isOriginalDeclaration);
+ Expect.isFalse(transformOfR.isOriginalDeclaration);
+ Expect.isFalse(transformOfDouble.isOriginalDeclaration);
// Function types.
typeParameters(reflectTypeDeclaration(NonGenericPredicate).referent, []);
@@ -78,42 +87,40 @@ main() {
typeArguments(transformOfDouble.referent, []);
// Function types are always non-generic. Only the typedef is generic.
- Expect.isTrue(reflectTypeDeclaration(NonGenericPredicate).referent.isOriginalDeclaration);
- Expect.isTrue(reflectTypeDeclaration(GenericPredicate).referent.isOriginalDeclaration);
- Expect.isTrue(reflectTypeDeclaration(GenericTransform).referent.isOriginalDeclaration);
- Expect.isTrue(predicateOfNum.referent.isOriginalDeclaration);
- Expect.isTrue(transformOfString.referent.isOriginalDeclaration);
+ Expect.isTrue(reflectTypeDeclaration(NonGenericPredicate)
+ .referent
+ .isOriginalDeclaration);
+ Expect.isTrue(
+ reflectTypeDeclaration(GenericPredicate).referent.isOriginalDeclaration);
+ Expect.isTrue(
+ reflectTypeDeclaration(GenericTransform).referent.isOriginalDeclaration);
+ Expect.isTrue(predicateOfNum.referent.isOriginalDeclaration);
+ Expect.isTrue(transformOfString.referent.isOriginalDeclaration);
Expect.isTrue(transformOfR.referent.isOriginalDeclaration);
- Expect.isTrue(transformOfDouble.referent.isOriginalDeclaration);
+ Expect.isTrue(transformOfDouble.referent.isOriginalDeclaration);
Expect.equals(reflectClass(num),
- reflectTypeDeclaration(NonGenericPredicate).referent.parameters[0].type);
+ reflectTypeDeclaration(NonGenericPredicate).referent.parameters[0].type);
Expect.equals(tFromGenericPredicate,
- reflectTypeDeclaration(GenericPredicate).referent.parameters[0].type);
+ reflectTypeDeclaration(GenericPredicate).referent.parameters[0].type);
Expect.equals(sFromGenericTransform,
- reflectTypeDeclaration(GenericTransform).referent.parameters[0].type);
+ reflectTypeDeclaration(GenericTransform).referent.parameters[0].type);
- Expect.equals(reflectClass(num),
- predicateOfNum.referent.parameters[0].type);
- Expect.equals(reflectClass(String),
- transformOfString.referent.parameters[0].type);
- Expect.equals(rFromC,
- transformOfR.referent.parameters[0].type);
- Expect.equals(reflectClass(double),
- transformOfDouble.referent.parameters[0].type);
+ Expect.equals(reflectClass(num), predicateOfNum.referent.parameters[0].type);
+ Expect.equals(
+ reflectClass(String), transformOfString.referent.parameters[0].type);
+ Expect.equals(rFromC, transformOfR.referent.parameters[0].type);
+ Expect.equals(
+ reflectClass(double), transformOfDouble.referent.parameters[0].type);
Expect.equals(reflectClass(bool),
- reflectTypeDeclaration(NonGenericPredicate).referent.returnType);
+ reflectTypeDeclaration(NonGenericPredicate).referent.returnType);
Expect.equals(reflectClass(bool),
- reflectTypeDeclaration(GenericPredicate).referent.returnType);
+ reflectTypeDeclaration(GenericPredicate).referent.returnType);
Expect.equals(sFromGenericTransform,
- reflectTypeDeclaration(GenericTransform).referent.returnType);
- Expect.equals(reflectClass(bool),
- predicateOfNum.referent.returnType);
- Expect.equals(reflectClass(String),
- transformOfString.referent.returnType);
- Expect.equals(rFromC,
- transformOfR.referent.returnType);
- Expect.equals(reflectClass(double),
- transformOfDouble.referent.returnType);
+ reflectTypeDeclaration(GenericTransform).referent.returnType);
+ Expect.equals(reflectClass(bool), predicateOfNum.referent.returnType);
+ Expect.equals(reflectClass(String), transformOfString.referent.returnType);
+ Expect.equals(rFromC, transformOfR.referent.returnType);
+ Expect.equals(reflectClass(double), transformOfDouble.referent.returnType);
}

Powered by Google App Engine
This is Rietveld 408576698