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

Side by Side Diff: tests/kernel/unsorted/superclass_test.dart

Issue 2434123003: Merge more Kernel infrastructure from kernel_sdk SDK fork. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 import 'expect.dart';
Kevin Millikin (Google) 2016/10/21 09:10:58 Copyright header.
Vyacheslav Egorov (Google) 2016/10/21 13:39:44 Done.
2
3 class A {
4 A() {
5 print("A");
6 }
7
8 hello() {
9 print("A.hello()");
10 return 1;
11 }
12
13 hello1(a) {
14 print("A.hello1()");
15 print(a);
16 return 1;
17 }
18
19 foo(a, [b]) {
20 print("A.foo()");
21 print(a);
22 print(b);
23 return 1;
24 }
25
26 bar(a, {b}) {
27 print("A.bar()");
28 print(a);
29 print(b);
30 return 1;
31 }
32 }
33
34 class B extends A {
35 hello() {
36 print("B.hello()");
37 return 2;
38 }
39
40 bar(a, {b}) {
41 print("B.bar()");
42 print(a);
43 print(b);
44 return 2;
45 }
46 }
47
48 main() {
49 var o = new B();
50
51 // Base class methods.
52 Expect.isTrue(o.hello1(1) == 1);
53 Expect.isTrue(o.foo(1) == 1);
54 Expect.isTrue(o.foo(1, 2) == 1);
55
56 // Overwritten methods.
57 Expect.isTrue(o.hello() == 2);
58 Expect.isTrue(o.bar(1) == 2);
59 Expect.isTrue(o.bar(1, b: 2) == 2);
60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698