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

Unified Diff: tests/language/call_operator_test.dart

Issue 2998493002: Migrate language block 45 - call_argument ... call_with. (Closed)
Patch Set: Merge branch 'master' into migrate-45 Created 3 years, 4 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/call_nonexistent_static_test.dart ('k') | tests/language/call_property_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/call_operator_test.dart
diff --git a/tests/language/call_operator_test.dart b/tests/language/call_operator_test.dart
deleted file mode 100644
index 6709ac74a2d6949277722bf0c782640f7ff71910..0000000000000000000000000000000000000000
--- a/tests/language/call_operator_test.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2012, 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.
-
-import "package:expect/expect.dart";
-
-// simple test with no types in signature
-class A1 {
- call() => 42;
-}
-
-// same test, include return type
-class A2 {
- int call() => 35;
-}
-
-class B {
- call() => 28;
-}
-
-// A call() operator can have any arity
-class C {
- call(arg) => 7 * arg;
-}
-
-// Test named arguments
-class D {
- call([arg = 6]) => 7 * arg;
-}
-
-// Non-trivial method body combination of positional and named.
-class E {
- String call(String str, {int count: 1}) {
- StringBuffer buffer = new StringBuffer();
- for (var i = 0; i < count; i++) {
- buffer.write(str);
- if (i < count - 1) {
- buffer.write(":");
- }
- }
- return buffer.toString();
- }
-}
-
-main() {
- var a1 = new A1();
- Expect.equals(42, a1());
- Expect.equals(42, a1.call());
-
- var a2 = new A2();
- Expect.equals(35, a2());
- Expect.equals(35, a2.call());
-
- var b = new B();
- Expect.equals(28, b());
- Expect.equals(28, b.call());
-
- var c = new C();
- Expect.equals(42, c(6));
- Expect.equals(42, c.call(6));
-
- var d = new D();
- Expect.equals(42, d());
- Expect.equals(7, d(1));
- Expect.equals(14, d(2));
- Expect.equals(42, d.call());
- Expect.equals(7, d.call(1));
- Expect.equals(14, d.call(2));
-
- var e = new E();
- Expect.equals("foo", e("foo"));
- Expect.equals("foo:foo", e("foo", count: 2));
- Expect.equals("foo:foo:foo", e("foo", count: 3));
- Expect.equals("foo", e.call("foo"));
- Expect.equals("foo:foo", e.call("foo", count: 2));
- Expect.equals("foo:foo:foo", e.call("foo", count: 3));
-
- Expect.isTrue(a1 is Function);
- Expect.isTrue(e is Function);
-}
« no previous file with comments | « tests/language/call_nonexistent_static_test.dart ('k') | tests/language/call_property_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698