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

Unified Diff: tests/kernel/unsorted/mixin_test.dart

Issue 2434123003: Merge more Kernel infrastructure from kernel_sdk SDK fork. (Closed)
Patch Set: address more comments Created 4 years, 2 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/kernel/unsorted/mixin_test.dart
diff --git a/tests/kernel/unsorted/mixin_test.dart b/tests/kernel/unsorted/mixin_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..58253d46f2b38d89a845a176d830a493bcc19dea
--- /dev/null
+++ b/tests/kernel/unsorted/mixin_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2016, 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.
+
+import 'expect.dart';
+
+class Base {
+ baseFoo() {
+ print('Base.baseFoo()');
+ return 1;
+ }
+
+ foo() {
+ print('Base.foo()');
+ return 1;
+ }
+}
+
+class Mixin {
+ mixinFoo() {
+ print('Mixin.mixinFoo()');
+ return 2;
+ }
+
+ foo() {
+ print('Mixin.foo()');
+ return 2;
+ }
+}
+
+class Mixin2 {
+ mixin2Foo() {
+ print('Mixin2.mixin2Foo()');
+ return 3;
+ }
+
+ foo() {
+ print('Mixin2.foo()');
+ return 3;
+ }
+}
+
+class Sub extends Base with Mixin, Mixin2 {
+ subFoo() {
+ print('Sub.subFoo()');
+ return 4;
+ }
+
+ foo() {
+ print('Sub.foo()');
+ return 4;
+ }
+}
+
+main() {
+ var o = new Sub();
+
+ Expect.isTrue(o.baseFoo() == 1);
+ Expect.isTrue(o.mixinFoo() == 2);
+ Expect.isTrue(o.mixin2Foo() == 3);
+ Expect.isTrue(o.subFoo() == 4);
+ Expect.isTrue(o.foo() == 4);
+}
+

Powered by Google App Engine
This is Rietveld 408576698