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

Unified Diff: tests/language/mixin_type_parameters_mixin_extends_test.dart

Issue 12036101: Add more tests and fix the parser to deal with generic superclasses for mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove newline. Created 7 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 | « tests/language/mixin_illegal_syntax_test.dart ('k') | tests/language/mixin_type_parameters_mixin_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/mixin_type_parameters_mixin_extends_test.dart
diff --git a/tests/language/mixin_type_parameters_super_test.dart b/tests/language/mixin_type_parameters_mixin_extends_test.dart
similarity index 65%
copy from tests/language/mixin_type_parameters_super_test.dart
copy to tests/language/mixin_type_parameters_mixin_extends_test.dart
index 5c4b66086fb760e851530ac50b430c5793980907..6db518803c29c6e6b6fa9117363c3ba1a779d0a8 100644
--- a/tests/language/mixin_type_parameters_super_test.dart
+++ b/tests/language/mixin_type_parameters_mixin_extends_test.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-class S<T> {
+class M<T> {
bool matches(o) {
bool isChecked = checkUsingIs(o);
if (checkedMode) {
@@ -35,91 +35,91 @@ class S<T> {
}
}
-class M {
+class S {
}
-typedef C0<T> = S with M;
-typedef C1<T> = S<T> with M;
-typedef C2<T> = S<int> with M;
-typedef C3 = S<String> with M;
+class C0<T> extends S with M { }
+class C1<T> extends S with M<T> { }
+class C2<T> extends S with M<int> { }
+class C3 extends S with M<String> { }
main() {
var c0 = new C0();
- Expect.isTrue(c0 is S);
- Expect.isTrue(c0 is S<int>);
- Expect.isTrue(c0 is S<String>);
+ Expect.isTrue(c0 is M);
+ Expect.isTrue(c0 is M<int>);
+ Expect.isTrue(c0 is M<String>);
Expect.isTrue(c0.matches(c0));
Expect.isTrue(c0.matches(42));
Expect.isTrue(c0.matches("hello"));
var c0_int = new C0<int>();
- Expect.isTrue(c0_int is S);
- Expect.isTrue(c0_int is S<int>);
- Expect.isTrue(c0_int is S<String>);
+ Expect.isTrue(c0_int is M);
+ Expect.isTrue(c0_int is M<int>);
+ Expect.isTrue(c0_int is M<String>);
Expect.isTrue(c0_int.matches(c0));
Expect.isTrue(c0_int.matches(42));
Expect.isTrue(c0_int.matches("hello"));
var c0_String = new C0<String>();
- Expect.isTrue(c0_String is S);
- Expect.isTrue(c0_String is S<int>);
- Expect.isTrue(c0_String is S<String>);
+ Expect.isTrue(c0_String is M);
+ Expect.isTrue(c0_String is M<int>);
+ Expect.isTrue(c0_String is M<String>);
Expect.isTrue(c0_String.matches(c0));
Expect.isTrue(c0_String.matches(42));
Expect.isTrue(c0_String.matches("hello"));
var c1 = new C1();
- Expect.isTrue(c1 is S);
- Expect.isTrue(c1 is S<int>);
- Expect.isTrue(c1 is S<String>);
+ Expect.isTrue(c1 is M);
+ Expect.isTrue(c1 is M<int>);
+ Expect.isTrue(c1 is M<String>);
Expect.isTrue(c1.matches(c1));
Expect.isTrue(c1.matches(42));
Expect.isTrue(c1.matches("hello"));
var c1_int = new C1<int>();
- Expect.isTrue(c1_int is S);
- Expect.isTrue(c1_int is S<int>);
- Expect.isFalse(c1_int is S<String>);
+ Expect.isTrue(c1_int is M);
+ Expect.isTrue(c1_int is M<int>);
+ Expect.isFalse(c1_int is M<String>);
Expect.isFalse(c1_int.matches(c1));
Expect.isTrue(c1_int.matches(42));
Expect.isFalse(c1_int.matches("hello"));
var c1_String = new C1<String>();
- Expect.isTrue(c1_String is S);
- Expect.isFalse(c1_String is S<int>);
- Expect.isTrue(c1_String is S<String>);
+ Expect.isTrue(c1_String is M);
+ Expect.isFalse(c1_String is M<int>);
+ Expect.isTrue(c1_String is M<String>);
Expect.isFalse(c1_String.matches(c1));
Expect.isFalse(c1_String.matches(42));
Expect.isTrue(c1_String.matches("hello"));
var c2 = new C2();
- Expect.isTrue(c2 is S);
- Expect.isTrue(c2 is S<int>);
- Expect.isFalse(c2 is S<String>);
+ Expect.isTrue(c2 is M);
+ Expect.isTrue(c2 is M<int>);
+ Expect.isFalse(c2 is M<String>);
Expect.isFalse(c2.matches(c2));
Expect.isTrue(c2.matches(42));
Expect.isFalse(c2.matches("hello"));
var c2_int = new C2<int>();
- Expect.isTrue(c2_int is S);
- Expect.isTrue(c2_int is S<int>);
- Expect.isFalse(c2_int is S<String>);
+ Expect.isTrue(c2_int is M);
+ Expect.isTrue(c2_int is M<int>);
+ Expect.isFalse(c2_int is M<String>);
Expect.isFalse(c2_int.matches(c2));
Expect.isTrue(c2_int.matches(42));
Expect.isFalse(c2_int.matches("hello"));
var c2_String = new C2<String>();
- Expect.isTrue(c2_String is S);
- Expect.isTrue(c2_String is S<int>);
- Expect.isFalse(c2_String is S<String>);
+ Expect.isTrue(c2_String is M);
+ Expect.isTrue(c2_String is M<int>);
+ Expect.isFalse(c2_String is M<String>);
Expect.isFalse(c2_String.matches(c2));
Expect.isTrue(c2_String.matches(42));
Expect.isFalse(c2_String.matches("hello"));
var c3 = new C3();
- Expect.isTrue(c3 is S);
- Expect.isFalse(c3 is S<int>);
- Expect.isTrue(c3 is S<String>);
+ Expect.isTrue(c3 is M);
+ Expect.isFalse(c3 is M<int>);
+ Expect.isTrue(c3 is M<String>);
Expect.isFalse(c3.matches(c2));
Expect.isFalse(c3.matches(42));
Expect.isTrue(c3.matches("hello"));
« no previous file with comments | « tests/language/mixin_illegal_syntax_test.dart ('k') | tests/language/mixin_type_parameters_mixin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698