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

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

Issue 2774783002: Re-land "Format all multitests" (Closed)
Patch Set: Created 3 years, 9 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 | « tests/lib/convert/base64_test.dart ('k') | tests/lib/mirrors/circular_factory_redirection_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/abstract_class_test.dart
diff --git a/tests/lib/mirrors/abstract_class_test.dart b/tests/lib/mirrors/abstract_class_test.dart
index 30f3c278e94e84e425439d22eaeeef8c3f85c2ba..e661d543091529e357b88f49486f8ace93822efb 100644
--- a/tests/lib/mirrors/abstract_class_test.dart
+++ b/tests/lib/mirrors/abstract_class_test.dart
@@ -19,6 +19,7 @@ void main() {
abstract class Foo {
foo();
}
+
class Bar extends Foo {
foo() {}
}
@@ -30,7 +31,6 @@ testSimple() {
Expect.isFalse(reflect(new Bar()).type.isAbstract);
}
-
void baz() {}
testFunctionType() {
@@ -40,6 +40,7 @@ testFunctionType() {
abstract class FunctionFoo implements Function {
call();
}
+
class FunctionBar extends FunctionFoo {
call() {}
}
@@ -54,6 +55,7 @@ testFakeFunction() {
abstract class GenericFoo<T> {
T genericFoo();
}
+
class GenericBar<T> extends GenericFoo<T> {
T genericFoo() {}
}
@@ -67,16 +69,18 @@ testGeneric() {
Expect.isFalse(reflect(new GenericBar<int>()).type.isAbstract);
}
-
class S {}
+
abstract class M {
mixinFoo();
}
-abstract class MA extends S with M {
-}
+
+abstract class MA extends S with M {}
+
class SubMA extends MA {
mixinFoo() {}
}
+
class ConcreteMA extends S with M {
mixinFoo() {}
}
@@ -84,12 +88,15 @@ class ConcreteMA extends S with M {
class M2 {
mixin2Foo() {}
}
+
abstract class MA2 extends S with M2 {
mixinBar();
}
+
class SubMA2 extends MA2 {
mixinBar() {}
}
+
class ConcreteMA2 extends S with M2 {
mixin2Foo() {}
}
@@ -97,73 +104,76 @@ class ConcreteMA2 extends S with M2 {
testAnonMixinApplication() {
// Application is abstract.
{
- // Mixin is abstract.
- Expect.isFalse(reflectClass(SubMA).isAbstract);
- Expect.isTrue(reflectClass(SubMA).superclass.isAbstract);
- Expect.isFalse(reflectClass(SubMA).superclass.superclass.isAbstract);
- Expect.isTrue(reflectClass(MA).isAbstract);
- Expect.isFalse(reflectClass(MA).superclass.isAbstract);
-
- // Mixin is concrete.
- Expect.isFalse(reflectClass(SubMA2).isAbstract);
- Expect.isTrue(reflectClass(SubMA2).superclass.isAbstract);
- Expect.isFalse(reflectClass(SubMA2).superclass.superclass.isAbstract);
- Expect.isTrue(reflectClass(MA2).isAbstract);
- Expect.isFalse(reflectClass(MA2).superclass.isAbstract);
+ // Mixin is abstract.
+ Expect.isFalse(reflectClass(SubMA).isAbstract);
+ Expect.isTrue(reflectClass(SubMA).superclass.isAbstract);
+ Expect.isFalse(reflectClass(SubMA).superclass.superclass.isAbstract);
+ Expect.isTrue(reflectClass(MA).isAbstract);
+ Expect.isFalse(reflectClass(MA).superclass.isAbstract);
+
+ // Mixin is concrete.
+ Expect.isFalse(reflectClass(SubMA2).isAbstract);
+ Expect.isTrue(reflectClass(SubMA2).superclass.isAbstract);
+ Expect.isFalse(reflectClass(SubMA2).superclass.superclass.isAbstract);
+ Expect.isTrue(reflectClass(MA2).isAbstract);
+ Expect.isFalse(reflectClass(MA2).superclass.isAbstract);
}
// Application is concrete.
{
- // Mixin is abstract.
- Expect.isFalse(reflectClass(ConcreteMA).isAbstract);
- Expect.isFalse(reflectClass(ConcreteMA).superclass.isAbstract);
- Expect.isFalse(reflectClass(ConcreteMA).superclass.superclass.isAbstract);
-
- // Mixin is concrete.
- Expect.isFalse(reflectClass(ConcreteMA2).isAbstract);
- Expect.isFalse(reflectClass(ConcreteMA2).superclass.isAbstract);
- Expect.isFalse(reflectClass(ConcreteMA2).superclass.superclass.isAbstract);
+ // Mixin is abstract.
+ Expect.isFalse(reflectClass(ConcreteMA).isAbstract);
+ Expect.isFalse(reflectClass(ConcreteMA).superclass.isAbstract);
+ Expect.isFalse(reflectClass(ConcreteMA).superclass.superclass.isAbstract);
+
+ // Mixin is concrete.
+ Expect.isFalse(reflectClass(ConcreteMA2).isAbstract);
+ Expect.isFalse(reflectClass(ConcreteMA2).superclass.isAbstract);
+ Expect.isFalse(reflectClass(ConcreteMA2).superclass.superclass.isAbstract);
}
}
abstract class NamedMA = S with M;
+
class SubNamedMA extends NamedMA {
mixinFoo() {}
}
class ConcreteNamedMA = S with M; //# 00: static type warning
abstract class NamedMA2 = S with M2;
+
class SubNamedMA2 extends NamedMA2 {
mixinFoo() {}
}
+
class ConcreteNamedMA2 = S with M2;
testNamedMixinApplication() {
// Application is abstract.
{
- // Mixin is abstract.
- Expect.isFalse(reflectClass(SubNamedMA).isAbstract);
- Expect.isTrue(reflectClass(SubNamedMA).superclass.isAbstract);
- Expect.isFalse(reflectClass(SubNamedMA).superclass.superclass.isAbstract);
- Expect.isTrue(reflectClass(NamedMA).isAbstract);
- Expect.isFalse(reflectClass(NamedMA).superclass.isAbstract);
-
- // Mixin is concrete.
- Expect.isFalse(reflectClass(SubNamedMA2).isAbstract);
- Expect.isTrue(reflectClass(SubNamedMA2).superclass.isAbstract);
- Expect.isFalse(reflectClass(SubNamedMA2).superclass.superclass.isAbstract);
- Expect.isTrue(reflectClass(NamedMA2).isAbstract);
- Expect.isFalse(reflectClass(NamedMA2).superclass.isAbstract);
+ // Mixin is abstract.
+ Expect.isFalse(reflectClass(SubNamedMA).isAbstract);
+ Expect.isTrue(reflectClass(SubNamedMA).superclass.isAbstract);
+ Expect.isFalse(reflectClass(SubNamedMA).superclass.superclass.isAbstract);
+ Expect.isTrue(reflectClass(NamedMA).isAbstract);
+ Expect.isFalse(reflectClass(NamedMA).superclass.isAbstract);
+
+ // Mixin is concrete.
+ Expect.isFalse(reflectClass(SubNamedMA2).isAbstract);
+ Expect.isTrue(reflectClass(SubNamedMA2).superclass.isAbstract);
+ Expect.isFalse(reflectClass(SubNamedMA2).superclass.superclass.isAbstract);
+ Expect.isTrue(reflectClass(NamedMA2).isAbstract);
+ Expect.isFalse(reflectClass(NamedMA2).superclass.isAbstract);
}
// Application is concrete.
{
- // Mixin is abstract.
+ // Mixin is abstract.
Expect.isFalse(reflectClass(ConcreteNamedMA).isAbstract); //# 00: ok
Expect.isFalse(reflectClass(ConcreteNamedMA).superclass.isAbstract); //# 00: ok
- // Mixin is concrete.
- Expect.isFalse(reflectClass(ConcreteNamedMA2).isAbstract);
- Expect.isFalse(reflectClass(ConcreteNamedMA2).superclass.isAbstract);
+ // Mixin is concrete.
+ Expect.isFalse(reflectClass(ConcreteNamedMA2).isAbstract);
+ Expect.isFalse(reflectClass(ConcreteNamedMA2).superclass.isAbstract);
}
}
« no previous file with comments | « tests/lib/convert/base64_test.dart ('k') | tests/lib/mirrors/circular_factory_redirection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698