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

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

Issue 17977002: - Remove arguments definition test from the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Dart test program for testing optional named parameters. 4 // Dart test program for testing optional named parameters.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 8
9 class OptionalNamedParametersTest { 9 class OptionalNamedParametersTest {
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 static int F31(int a, {int b: 20, int c: 30}) { 43 static int F31(int a, {int b: 20, int c: 30}) {
44 return 100*(100*a + b) + c; 44 return 100*(100*a + b) + c;
45 } 45 }
46 46
47 int f42(int a, {int b: 20, int c: 30}) { 47 int f42(int a, {int b: 20, int c: 30}) {
48 return 100*(100*a + b) + c; 48 return 100*(100*a + b) + c;
49 } 49 }
50 50
51 static int F41(int a, {int b: 20, int c, int d: 40}) { 51 static int F41(int a, {int b: 20, int c, int d: 40}) {
52 return 100*(100*(100*a + b) + (?c ? c : 0)) + d; 52 return 100*(100*(100*a + b) + ((c != null) ? c : 0)) + d;
53 } 53 }
54 54
55 int f52(int a, {int b: 20, int c, int d: 40}) { 55 int f52(int a, {int b: 20, int c, int d: 40}) {
56 return 100*(100*(100*a + b) + (?c ? c : 0)) + d; 56 return 100*(100*(100*a + b) + ((c != null) ? c : 0)) + d;
57 } 57 }
58 58
59 static void test() { 59 static void test() {
60 OptionalNamedParametersTest np = new OptionalNamedParametersTest(); 60 OptionalNamedParametersTest np = new OptionalNamedParametersTest();
61 Expect.equals(0, F00()); 61 Expect.equals(0, F00());
62 Expect.equals(0, np.f11()); 62 Expect.equals(0, np.f11());
63 Expect.equals(10, F11(10)); 63 Expect.equals(10, F11(10));
64 Expect.equals(10, np.f22(10)); 64 Expect.equals(10, np.f22(10));
65 Expect.equals(20, F10()); 65 Expect.equals(20, F10());
66 Expect.equals(20, np.f21()); 66 Expect.equals(20, np.f21());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 Expect.equals(10253545, F41(10, d:45, c:35, b:25)); 98 Expect.equals(10253545, F41(10, d:45, c:35, b:25));
99 Expect.equals(10253545, np.f52(10, d:45, c:35, b:25)); 99 Expect.equals(10253545, np.f52(10, d:45, c:35, b:25));
100 } 100 }
101 } 101 }
102 102
103 main() { 103 main() {
104 OptionalNamedParametersTest.test(); 104 OptionalNamedParametersTest.test();
105 } 105 }
106 106
107 // TODO(regis): negative tests: [} {] [a:0] {a=0} 107 // TODO(regis): negative tests: [} {] [a:0] {a=0}
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698