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/lib/mirrors/circular_factory_redirection_test.dart

Issue 2669233002: Use factory syntax in circular_factory_redirection_test. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/circular_factory_redirection_test.dart
diff --git a/tests/lib/mirrors/circular_factory_redirection_test.dart b/tests/lib/mirrors/circular_factory_redirection_test.dart
index a7b188217a829d379853406188e3f6cbd7e7581f..b83385450922ead22bca3edadd20382e66f9a3cd 100644
--- a/tests/lib/mirrors/circular_factory_redirection_test.dart
+++ b/tests/lib/mirrors/circular_factory_redirection_test.dart
@@ -7,31 +7,30 @@ import "package:expect/expect.dart";
class A {
A();
- A.circular() = B.circular; /// 01: compile-time error
- const A.circular2() = B.circular2; /// 02: compile-time error
+ factory A.circular() = B.circular;
+ const factory A.circular2() = B.circular2;
}
-class B {
+class B implements A {
B();
- B.circular() = C.circular; /// 01: continued
- const B.circular2() = C.circular2; /// 02: continued
+ factory B.circular() = C.circular;
+ const factory B.circular2() = C.circular2;
}
-class C {
- C();
- C.circular() = A.circular; /// 01: continued
- const C.circular2() = A.circular2; /// 02: continued
+class C implements B {
+ const C();
+ factory C.circular()
+ /* /// 01: compile-time error
+ = C;
+ */ = A.circular; /// 01: continued
+
+ const factory C.circular2()
+ /* /// 02: compile-time error
+ = C;
+ */ = A.circular2; /// 02: continued
}
main() {
ClassMirror cm = reflectClass(A);
- new A.circular(); /// 01: continued
- new A.circular2(); /// 02: continued
-
- Expect.throws(() => cm.newInstance(#circular, []),
- (e) => e is NoSuchMethodError,
- 'Should disallow circular redirection (non-const)');
-
- Expect.throws(() => cm.newInstance(#circular2, []),
- (e) => e is NoSuchMethodError,
- 'Should disallow circular redirection (const)');
+ new A.circular();
+ new A.circular2();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698