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

Unified Diff: tests/language/src/NamedParametersNamedCountTest.dart

Issue 8229041: Test for named parameter called 'count'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/NamedParametersNamedCountTest.dart
diff --git a/tests/language/src/NamedParametersNamedCountTest.dart b/tests/language/src/NamedParametersNamedCountTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9c467049614edc74b44ca4d897870532b2dedc37
--- /dev/null
+++ b/tests/language/src/NamedParametersNamedCountTest.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test for named parameter called 'count'.
+
+
+class TestClass {
+ TestClass();
+
+ method([count]) => count;
+
+ static staticMethod([count]) => count;
+}
+
+globalMethod([count]) => count;
+
+
+main() {
+ var obj = new TestClass();
+
+ Expect.equals(null, obj.method());
+ Expect.equals(0, obj.method(0));
+ Expect.equals(0, obj.method(count: 0));
+ Expect.equals("", obj.method(""));
+ Expect.equals("", obj.method(count: ""));
+
+ Expect.equals(null, TestClass.staticMethod());
+ Expect.equals(true, TestClass.staticMethod(true));
+ Expect.equals(true, TestClass.staticMethod(count: true));
+ Expect.equals(false, TestClass.staticMethod(false));
+ Expect.equals(false, TestClass.staticMethod(count: false));
+
+ Expect.equals(null, globalMethod());
+ Expect.equals(true, globalMethod(true));
+ Expect.equals(true, globalMethod(count: true));
+ Expect.equals(false, globalMethod(false));
+ Expect.equals(false, globalMethod(count: false));
+}
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698