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

Side by Side Diff: tests/language/parameter_initializer_test.dart

Issue 10918261: Update language tests to new optional parameter syntax and semantics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class ParameterInitializerTest { 5 class ParameterInitializerTest {
6 6
7 static testMain() { 7 static testMain() {
8 var obj = new Foo.untyped(1); 8 var obj = new Foo.untyped(1);
9 Expect.equals(1, obj.x); 9 Expect.equals(1, obj.x);
10 10
11 obj = new Foo.supertype(9); 11 obj = new Foo.supertype(9);
12 Expect.equals(9, obj.x); 12 Expect.equals(9, obj.x);
13 13
14 obj = new Foo.subtype(7); 14 obj = new Foo.subtype(7);
15 Expect.equals(7, obj.x); 15 Expect.equals(7, obj.x);
16 16
17 obj = new Foo.optional(x: 111); 17 obj = new Foo.optional(111);
18 Expect.equals(111, obj.x); 18 Expect.equals(111, obj.x);
19 19
20 obj = new Foo.optional(); 20 obj = new Foo.optional();
21 Expect.equals(5, obj.x); 21 Expect.equals(5, obj.x);
22 22
23 obj = new Foo(1); 23 obj = new Foo(1);
24 Expect.equals(2, obj.x); 24 Expect.equals(2, obj.x);
25 25
26 obj = new SubFoo(42); 26 obj = new SubFoo(42);
27 Expect.equals(1, obj.x); 27 Expect.equals(1, obj.x);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 Expect.equals(x_, 1); 74 Expect.equals(x_, 1);
75 75
76 // There is no way to get to the field in Foo. 76 // There is no way to get to the field in Foo.
77 Expect.equals(super.x, 1); 77 Expect.equals(super.x, 1);
78 } 78 }
79 } 79 }
80 80
81 main() { 81 main() {
82 ParameterInitializerTest.testMain(); 82 ParameterInitializerTest.testMain();
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698