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

Unified Diff: tests/language/generic_closure_test.dart

Issue 3008573002: Migrate test block 113 to Dart 2.0. (Closed)
Patch Set: Merge fixups 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/generic2_test.dart ('k') | tests/language/generic_creation_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_closure_test.dart
diff --git a/tests/language/generic_closure_test.dart b/tests/language/generic_closure_test.dart
deleted file mode 100644
index 56ca38c4a6eca753c0ecd9b37445cfeec16b3770..0000000000000000000000000000000000000000
--- a/tests/language/generic_closure_test.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2014, 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 constructors and initializers.
-
-// Check that generic closures are properly instantiated.
-
-import 'package:expect/expect.dart';
-
-typedef T F<T>(T x);
-typedef R G<T, R>(T x);
-
-class C<T> {
- get f => (T x) => 2 * x;
- T g(T x) => 3 * x;
-}
-
-main() {
- var c = new C<int>();
- var f = c.f;
- var g = c.g;
- Expect.equals(42, f(21));
- Expect.equals(42, g(14));
- Expect.isTrue(f is Function);
- Expect.isTrue(g is Function);
- Expect.isTrue(f is F);
- Expect.isTrue(g is F);
- Expect.isTrue(f is F<int>);
- Expect.isTrue(g is F<int>);
- Expect.isTrue(f is! F<bool>);
- Expect.isTrue(g is! F<bool>);
- Expect.isTrue(f is G<int, int>);
- Expect.isTrue(g is G<int, int>);
- Expect.isTrue(f is G<int, bool>);
- Expect.isTrue(g is! G<int, bool>);
- Expect.equals("(int) => dynamic", f.runtimeType.toString());
- Expect.equals("(int) => int", g.runtimeType.toString());
-
- c = new C<bool>();
- f = c.f;
- g = c.g;
- Expect.isTrue(f is F);
- Expect.isTrue(g is F);
- Expect.isTrue(f is! F<int>);
- Expect.isTrue(g is! F<int>);
- Expect.isTrue(f is F<bool>);
- Expect.isTrue(g is F<bool>);
- Expect.equals("(bool) => dynamic", f.runtimeType.toString());
- Expect.equals("(bool) => bool", g.runtimeType.toString());
-
- c = new C();
- f = c.f;
- g = c.g;
- Expect.isTrue(f is F);
- Expect.isTrue(g is F);
- Expect.isTrue(f is F<int>);
- Expect.isTrue(g is F<int>);
- Expect.isTrue(f is F<bool>);
- Expect.isTrue(g is F<bool>);
- Expect.equals("(dynamic) => dynamic", f.runtimeType.toString());
- Expect.equals("(dynamic) => dynamic", g.runtimeType.toString());
-}
« no previous file with comments | « tests/language/generic2_test.dart ('k') | tests/language/generic_creation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698