mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
bc3a4a660f
Change-Id: Ie7bbea5faa07dcc41f551268bd730bf0416e1fef Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286280 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Jake Macdonald <jakemac@google.com> Auto-Submit: Jake Macdonald <jakemac@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
54 lines
1.4 KiB
Dart
54 lines
1.4 KiB
Dart
// 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.
|
|
|
|
library mixin_lib_extends_method_test;
|
|
|
|
import "package:expect/expect.dart";
|
|
import "lib_extends_method_lib.dart" as L;
|
|
|
|
class S {
|
|
foo() => "S-foo";
|
|
baz() => "S-baz";
|
|
}
|
|
|
|
class C extends S with L.M1 {}
|
|
|
|
class D extends S with L.M1, L.M2 {}
|
|
|
|
class E extends S with L.M2, L.M1 {}
|
|
|
|
class F extends E {
|
|
fez() => "F-fez";
|
|
}
|
|
|
|
main() {
|
|
dynamic c = new C();
|
|
Expect.equals("S-foo", c.foo());
|
|
Expect.equals("M1-bar", c.bar());
|
|
Expect.equals("S-baz", c.baz());
|
|
Expect.throwsNoSuchMethodError(() => c.fez());
|
|
Expect.equals("sugus", c.clo("su")("gus"));
|
|
|
|
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());
|
|
Expect.equals("sugus", d.clo("su")("gus"));
|
|
|
|
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());
|
|
Expect.equals("sugus", e.clo("su")("gus"));
|
|
|
|
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());
|
|
Expect.equals("sugus", f.clo("su")("gus"));
|
|
}
|