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

Unified Diff: tests/language/mixin_naming_test.dart

Issue 11886097: Get the most basic mixin applications working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix checked mode. 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
Index: tests/language/mixin_naming_test.dart
diff --git a/tests/language/mixin_naming_test.dart b/tests/language/mixin_naming_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6aaa2acd17c5c57a9d2402de87671dcf93960155
--- /dev/null
+++ b/tests/language/mixin_naming_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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 { }
+class M1 { }
+class M2 { }
+class M3 { }
+
+typedef C = S with M1, M2, M3;
+
+class S_M1 { }
+class S_M1_M2 { }
+
+main() {
+ var c = new C();
+ Expect.isTrue(c is C);
+ Expect.isTrue(c is S);
+ Expect.isFalse(c is S_M1);
+ Expect.isFalse(c is S_M1_M2);
+
+ var sm = new S_M1();
+ Expect.isFalse(sm is C);
+ Expect.isFalse(sm is S);
+ Expect.isTrue(sm is S_M1);
+ Expect.isFalse(sm is S_M1_M2);
+
+ var smm = new S_M1_M2();
+ Expect.isFalse(smm is C);
+ Expect.isFalse(smm is S);
+ Expect.isFalse(smm is S_M1);
+ Expect.isTrue(smm is S_M1_M2);
+}
« tests/language/mixin_field_test.dart ('K') | « tests/language/mixin_method_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698