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

Unified Diff: tests/language/tearoff_constructor_basic_test.dart

Issue 2608363002: Remove tests for generalized tear-offs. (Closed)
Patch Set: Created 3 years, 12 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/tearoff_basic_test.dart ('k') | tests/language_strong/language_strong.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/tearoff_constructor_basic_test.dart
diff --git a/tests/language/tearoff_constructor_basic_test.dart b/tests/language/tearoff_constructor_basic_test.dart
deleted file mode 100644
index 27c34d93e300ccd081d8d63c53a0fc767ae68e0a..0000000000000000000000000000000000000000
--- a/tests/language/tearoff_constructor_basic_test.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// Basic test for tear-off constructor closures.
-
-import "package:expect/expect.dart";
-
-class A {
- // Implicit constructor A();
- var f1 = "A.f1";
-}
-
-class P {
- var x, y;
- P(this.x, this.y);
- factory P.origin() { return new P(0,0); }
- factory P.ursprung() = P.origin;
- P.onXAxis(x) : this(x, 0);
-}
-
-class C<T> {
- T f1;
- C(T p) : f1 = p;
- C.n([T p]) : f1 = p;
- listMaker() { return new List<T>#; } // Closurize type parameter.
-}
-
-
-testMalformed() {
- Expect.throws(() => new NoSuchClass#);
- Expect.throws(() => new A#noSuchContstructor);
-}
-
-testA() {
- var cc = new A#; // Closurize implicit constructor.
- var o = cc();
- Expect.equals("A.f1", o.f1);
- Expect.equals("A.f1", (new A#)().f1);
- Expect.throws(() => new A#foo);
-}
-
-testP() {
- var cc = new P#origin;
- var o = cc();
- Expect.equals(0, o.x);
- cc = new P#ursprung;
- o = cc();
- Expect.equals(0, o.x);
- cc = new P#onXAxis;
- o = cc(5);
- Expect.equals(0, o.y);
- Expect.equals(5, o.x);
- Expect.throws(() => cc(1, 1)); // Too many arguments.
-}
-
-testC() {
- var cc = new C<int>#;
- var o = cc(5);
- Expect.equals("int", "${o.f1.runtimeType}");
- Expect.throws(() => cc()); // Missing constructor parameter.
-
- cc = new C<String>#n;
- o = cc("foo");
- Expect.equals("String", "${o.f1.runtimeType}");
- o = cc();
- Expect.equals(null, o.f1);
-
- cc = o.listMaker();
- Expect.isTrue(cc is Function);
- var l = cc();
- Expect.equals("List<String>", "${l.runtimeType}");
-}
-
-main() {
- testA();
- testC();
- testP();
- testMalformed();
-}
« no previous file with comments | « tests/language/tearoff_basic_test.dart ('k') | tests/language_strong/language_strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698