| Index: tests/language/mixin_method_test.dart
|
| diff --git a/tests/language/mixin_method_test.dart b/tests/language/mixin_method_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d5643f783b2185e383bbfa86f31dc66c44b722a7
|
| --- /dev/null
|
| +++ b/tests/language/mixin_method_test.dart
|
| @@ -0,0 +1,52 @@
|
| +// 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 {
|
| + foo() => "S-foo";
|
| + baz() => "S-baz";
|
| +}
|
| +
|
| +class M1 {
|
| + bar() => "M1-bar";
|
| +}
|
| +
|
| +class M2 {
|
| + bar() => "M2-bar";
|
| + baz() => "M2-baz";
|
| + fez() => "M2-fez";
|
| +}
|
| +
|
| +typedef C = S with M1;
|
| +typedef D = S with M1, M2;
|
| +typedef E = S with M2, M1;
|
| +
|
| +class F extends E {
|
| + fez() => "F-fez";
|
| +}
|
| +
|
| +main() {
|
| + var c = new C();
|
| + Expect.equals("S-foo", c.foo());
|
| + Expect.equals("M1-bar", c.bar());
|
| + Expect.equals("S-baz", c.baz());
|
| + Expect.throws(() => c.fez(), (error) => error is NoSuchMethodError);
|
| +
|
| + var d = new D();
|
| + Expect.equals("S-foo", d.foo());
|
| + Expect.equals("M2-bar", d.bar());
|
| + Expect.equals("M2-baz", d.baz());
|
| + Expect.equals("M2-fez", d.fez());
|
| +
|
| + var e = new E();
|
| + Expect.equals("S-foo", e.foo());
|
| + Expect.equals("M1-bar", e.bar());
|
| + Expect.equals("M2-baz", e.baz());
|
| + Expect.equals("M2-fez", e.fez());
|
| +
|
| + var f = new F();
|
| + Expect.equals("S-foo", f.foo());
|
| + Expect.equals("M1-bar", f.bar());
|
| + Expect.equals("M2-baz", f.baz());
|
| + Expect.equals("F-fez", f.fez());
|
| +}
|
|
|