Skip to content

Commit 4a2ce6a

Browse files
committed
add test
1 parent 0cdd082 commit 4a2ce6a

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

lib/test/DemoMixins.dart

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,92 @@
44
*/
55

66
abstract class Base {
7-
a();
7+
a() {
8+
9+
}
10+
b() {
11+
12+
}
813
}
914

10-
class S extends Base with A {
15+
class S extends Base {
1116
a() {
12-
super.a();
1317
print("S.a");
18+
super.a();
1419
}
1520
}
1621

1722
class A extends Base {
1823
a() {
1924
print("A.a");
25+
super.a();
2026
}
2127

2228
b() {
2329
print("A.b");
30+
super.b();
31+
}
32+
}
33+
34+
class A1 extends Base {
35+
a() {
36+
print("A1.a");
37+
super.a();
38+
}
39+
40+
b() {
41+
print("A1.b");
42+
super.b();
43+
}
44+
}
45+
46+
class A2 extends Base {
47+
a() {
48+
print("A2.a");
49+
super.a();
50+
}
51+
52+
b() {
53+
print("A2.b");
54+
super.b();
2455
}
2556
}
2657

2758
class B extends Base {
2859
a() {
2960
print("B.a");
61+
super.a();
3062
}
3163

3264
b() {
3365
print("B.b");
66+
super.b();
3467
}
3568

3669
c() {
3770
print("B.c ");
3871
}
3972
}
4073

41-
class T = B with A, S;
74+
class T = B with A1, A2, A, S;
4275

4376

4477
testMixins() {
4578
T t = new T();
4679
t.a();
4780
t.b();
4881
t.c();
49-
}
82+
}
83+
84+
/**
85+
* I/flutter ( 1864): S.a
86+
I/flutter ( 1864): A.a
87+
I/flutter ( 1864): A2.a
88+
I/flutter ( 1864): A1.a
89+
I/flutter ( 1864): B.a
90+
I/flutter ( 1864): A.b
91+
I/flutter ( 1864): A2.b
92+
I/flutter ( 1864): A1.b
93+
I/flutter ( 1864): B.b
94+
I/flutter ( 1864): B.c
95+
* */

0 commit comments

Comments
 (0)