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

Unified Diff: tests/language/function_subtype_checked0_test.dart

Issue 17413013: Revert "Support runtime check of function types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/function_subtype_cast3_test.dart ('k') | tests/language/function_subtype_closure0_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_subtype_checked0_test.dart
diff --git a/tests/language/function_subtype_checked0_test.dart b/tests/language/function_subtype_checked0_test.dart
deleted file mode 100644
index ee293d62b654d259af9a6d1452f951b11c3a957a..0000000000000000000000000000000000000000
--- a/tests/language/function_subtype_checked0_test.dart
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2013, 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 function subtyping of typedef vs. inlined function types.
-
-import 'package:expect/expect.dart';
-
-typedef int Foo<T>(T a, [String b]);
-typedef int Bar<T>(T a, [String b]);
-typedef int Baz<T>(T a, {String b});
-typedef int Boz<T>(T a);
-
-int foo(bool a, [String b]) => null;
-int baz(bool a, {String b}) => null;
-int boz(bool a, {int b}) => null;
-
-class C<T> {
- void test1a(Foo<T> f) {}
- void test1b(Bar<T> f) {}
- void test1c(int f(T a, [String b])) {}
-
- void test2a(Baz<T> f) {}
- void test2b(int f(T a, {String b})) {}
-
- void test3a(Boz<T> f) {}
- void test3b(int f(T a)) {}
-
- void test(String nameOfT, bool expectedResult) {
- check(bool expectedResult, f()) {
- if (inCheckedMode() && !expectedResult) {
- Expect.throws(f, (e) => true);
- } else {
- f();
- }
- }
-
- check(expectedResult, () => test1a(foo));
- check(expectedResult, () => test1b(foo));
- check(expectedResult, () => test1b(foo));
- check(false, () => test2a(foo));
- check(false, () => test2b(foo));
- check(expectedResult, () => test3a(foo));
- check(expectedResult, () => test3b(foo));
-
- check(false, () => test1a(baz));
- check(false, () => test1b(baz));
- check(false, () => test1b(baz));
- check(expectedResult, () => test2a(baz));
- check(expectedResult, () => test2b(baz));
- check(expectedResult, () => test3a(baz));
- check(expectedResult, () => test3b(baz));
-
- check(false, () => test1a(boz));
- check(false, () => test1b(boz));
- check(false, () => test1b(boz));
- check(false, () => test2a(boz));
- check(false, () => test2b(boz));
- check(expectedResult, () => test3a(boz));
- check(expectedResult, () => test3b(boz));
- }
-}
-
-main() {
- new C<bool>().test('bool', true);
- new C<int>().test('int', false);
- new C().test('dynamic', true);
-}
-
-bool inCheckedMode() {
- try {
- var x = 42;
- String a = x;
- } catch (e) {
- return true;
- }
- return false;
-}
« no previous file with comments | « tests/language/function_subtype_cast3_test.dart ('k') | tests/language/function_subtype_closure0_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698