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

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

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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/src/Param1Test.dart ('k') | tests/language/src/ParamTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/Param2Test.dart
diff --git a/tests/language/src/Param2Test.dart b/tests/language/src/Param2Test.dart
deleted file mode 100644
index bedb313f78d2ab20b0978a972a2d8ae204a95924..0000000000000000000000000000000000000000
--- a/tests/language/src/Param2Test.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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.
-// Dart test program for testing function type parameters.
-
-
-class Param2Test {
-
- static forEach(List<int> a, int f(k)) {
- for (int i = 0; i < a.length; i++) {
- a[i] = f(a[i]);
- }
- }
-
- static int apply(f(int k), int arg) {
- var res = f(arg);
- return res;
- }
-
- static exists(List<int> a, f(e)) {
- for (int i = 0; i < a.length; i++) {
- if (f(a[i])) return true;
- }
- return false;
- }
-
- static testMain() {
- int square(int x) {
- return x * x;
- }
- Expect.equals(4, apply(square, 2));
- Expect.equals(100, apply(square, 10));
-
- var v = [1, 2, 3, 4, 5, 6];
- forEach(v, square);
- Expect.equals(1, v[0]);
- Expect.equals(4, v[1]);
- Expect.equals(9, v[2]);
- Expect.equals(16, v[3]);
- Expect.equals(25, v[4]);
- Expect.equals(36, v[5]);
-
- isOdd(element) {
- return element % 2 == 1;
- }
-
- Expect.equals(true, exists([3, 5, 7, 11, 13], isOdd));
- Expect.equals(false, exists([2, 4, 10], isOdd));
- Expect.equals(false, exists([], isOdd));
-
- v = [4, 5, 7];
- Expect.equals(true, exists(v, (e) => e % 2 == 1));
- Expect.equals(false, exists(v, f(e) => e == 6));
-
- var isZero = (e) => e == 0;
- Expect.equals(false, exists(v, isZero));
- }
-}
-
-
-main() {
- Param2Test.testMain();
-}
« no previous file with comments | « tests/language/src/Param1Test.dart ('k') | tests/language/src/ParamTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698