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

Unified Diff: tests/language/argument_definition_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 side-by-side diff with in-line comments
Download patch
Index: tests/language/argument_definition_test.dart
===================================================================
--- tests/language/argument_definition_test.dart (revision 12414)
+++ tests/language/argument_definition_test.dart (working copy)
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing argument definition test.
-int test(int a, [int b = 2, int c = 3]) {
+int test(int a, {int b: 2, int c: 3}) {
int result = 0;
?b;
?result; /// 01: compile-time error
@@ -26,7 +26,7 @@
return result;
}
-closure_test(int a, [int b = 2, int c = 3]) {
+closure_test(int a, {int b: 2, int c: 3}) {
var x = 0;
return () {
int result = 0;
@@ -59,13 +59,13 @@
// Use a loop to test optimized version as well.
for (int i = 0; i < 1000; i++) {
Expect.equals(100, test(1));
- Expect.equals(720, test(1, 2));
- Expect.equals(523, test(1, 2, 3));
- Expect.equals(703, test(1, c:3));
+ Expect.equals(720, test(1, b: 2));
+ Expect.equals(523, test(1, b: 2, c: 3));
+ Expect.equals(703, test(1, c: 3));
Expect.equals(100, closure_test(1)());
- Expect.equals(720, closure_test(1, 2)());
- Expect.equals(523, closure_test(1, 2, 3)());
- Expect.equals(703, closure_test(1, c:3)());
+ Expect.equals(720, closure_test(1, b: 2)());
+ Expect.equals(523, closure_test(1, b: 2, c: 3)());
+ Expect.equals(703, closure_test(1, c: 3)());
}
}

Powered by Google App Engine
This is Rietveld 408576698