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

Unified Diff: tests/language/src/MethodOverrideTest.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/MethodNameTest.dart ('k') | tests/language/src/MultiAssignTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/MethodOverrideTest.dart
diff --git a/tests/language/src/MethodOverrideTest.dart b/tests/language/src/MethodOverrideTest.dart
deleted file mode 100644
index ff00cef6551904c47920410f1a2611015cbf9afc..0000000000000000000000000000000000000000
--- a/tests/language/src/MethodOverrideTest.dart
+++ /dev/null
@@ -1,59 +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.
-
-// Checks that a method with an instantiated return type can override a method
-// with a generic return type.
-
-typedef Collection<K> GetKeysFunctionType<K>();
-
-class MapBase<K, V> implements Map<K, V> {
- Collection<K> getKeys() {
- throw 'Must be implemented';
- }
-
- void Tests() {
- Expect.isTrue(this is MapBase<int, int>);
-
- Expect.isTrue(getKeys is GetKeysFunctionType);
- Expect.isTrue(getKeys is GetKeysFunctionType<int>);
- Expect.isTrue(getKeys is !GetKeysFunctionType<String>);
- Expect.isTrue(getKeys is !GetKeysFunctionType<MapBase<int, int>>);
- }
-}
-
-
-class MethodOverrideTest extends MapBase<String, String> {
- Collection<String> getKeys() {
- throw 'Is implemented';
- }
-
- void Tests() {
- Expect.isTrue(this is MethodOverrideTest);
- Expect.isTrue(this is MapBase<String, String>);
-
- Expect.isTrue(getKeys is GetKeysFunctionType);
- Expect.isTrue(getKeys is GetKeysFunctionType<String>);
- Expect.isTrue(getKeys is !GetKeysFunctionType<int>);
- Expect.isTrue(super.getKeys is GetKeysFunctionType);
- Expect.isTrue(super.getKeys is GetKeysFunctionType<String>);
- Expect.isTrue(super.getKeys is !GetKeysFunctionType<int>);
- }
-}
-
-
-main() {
- // Since method overriding is only checked statically, explicitly check
- // the subtyping relation using a function type alias.
- var x = new MethodOverrideTest();
- Expect.isTrue(x.getKeys is GetKeysFunctionType<String>);
-
- // Perform a few more tests.
- x.Tests();
-
- var m = new MapBase<int, int>();
- Expect.isTrue(m.getKeys is GetKeysFunctionType<int>);
-
- // Perform a few more tests.
- m.Tests();
-}
« no previous file with comments | « tests/language/src/MethodNameTest.dart ('k') | tests/language/src/MultiAssignTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698