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

Unified Diff: tests/language/named_parameters_passing_falsy_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/named_parameters_passing_falsy_test.dart
===================================================================
--- tests/language/named_parameters_passing_falsy_test.dart (revision 12414)
+++ tests/language/named_parameters_passing_falsy_test.dart (working copy)
@@ -10,19 +10,22 @@
TestClass();
method([value = 100]) => value;
+ method2({value: 100}) => value;
static staticMethod([value = 200]) => value;
+ static staticMethod2({value: 200}) => value;
}
globalMethod([value = 300]) => value;
+globalMethod2({value: 300}) => value;
const testValues = const [0, 0.0, '', false, null];
-testFunction(f) {
+testFunction(f, f2) {
Expect.isTrue(f() >= 100);
for (var v in testValues) {
Expect.equals(v, f(v));
- Expect.equals(v, f(value: v));
+ Expect.equals(v, f2(value: v));
}
}
@@ -30,20 +33,23 @@
var obj = new TestClass();
Expect.equals(100, obj.method());
+ Expect.equals(100, obj.method2());
Expect.equals(200, TestClass.staticMethod());
+ Expect.equals(200, TestClass.staticMethod2());
Expect.equals(300, globalMethod());
+ Expect.equals(300, globalMethod2());
for (var v in testValues) {
Expect.equals(v, obj.method(v));
- Expect.equals(v, obj.method(value: v));
+ Expect.equals(v, obj.method2(value: v));
Expect.equals(v, TestClass.staticMethod(v));
- Expect.equals(v, TestClass.staticMethod(value: v));
+ Expect.equals(v, TestClass.staticMethod2(value: v));
Expect.equals(v, globalMethod(v));
- Expect.equals(v, globalMethod(value: v));
+ Expect.equals(v, globalMethod2(value: v));
}
// Test via indirect call.
- testFunction(obj.method);
- testFunction(TestClass.staticMethod);
- testFunction(globalMethod);
+ testFunction(obj.method, obj.method2);
+ testFunction(TestClass.staticMethod, TestClass.staticMethod2);
+ testFunction(globalMethod, globalMethod2);
}

Powered by Google App Engine
This is Rietveld 408576698