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

Unified Diff: tests/language/method_override_test.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 2 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/map_test.dart ('k') | tests/language/ordered_maps_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/method_override_test.dart
diff --git a/tests/language/method_override_test.dart b/tests/language/method_override_test.dart
index ff00cef6551904c47920410f1a2611015cbf9afc..514f7fc7aa496680999576d0674488228424942d 100644
--- a/tests/language/method_override_test.dart
+++ b/tests/language/method_override_test.dart
@@ -5,39 +5,39 @@
// Checks that a method with an instantiated return type can override a method
// with a generic return type.
-typedef Collection<K> GetKeysFunctionType<K>();
+typedef V RemoveFunctionType<K, V>(K key);
class MapBase<K, V> implements Map<K, V> {
- Collection<K> getKeys() {
+ K remove(K key) {
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>>);
+ Expect.isTrue(remove is RemoveFunctionType);
+ Expect.isTrue(remove is RemoveFunctionType<int, int>);
+ Expect.isTrue(remove is !RemoveFunctionType<String, int>);
+ Expect.isTrue(remove is !RemoveFunctionType<MapBase<int, int>, int>);
}
}
class MethodOverrideTest extends MapBase<String, String> {
- Collection<String> getKeys() {
- throw 'Is implemented';
+ String remove(String key) {
+ throw 'Must be 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>);
+ Expect.isTrue(remove is RemoveFunctionType);
+ Expect.isTrue(remove is RemoveFunctionType<String, String>);
+ Expect.isTrue(remove is !RemoveFunctionType<int, int>);
+ Expect.isTrue(super.remove is RemoveFunctionType);
+ Expect.isTrue(super.remove is RemoveFunctionType<String, String>);
+ Expect.isTrue(super.remove is !RemoveFunctionType<int, int>);
}
}
@@ -46,13 +46,13 @@ 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>);
+ Expect.isTrue(x.remove is RemoveFunctionType<String, String>);
// Perform a few more tests.
x.Tests();
var m = new MapBase<int, int>();
- Expect.isTrue(m.getKeys is GetKeysFunctionType<int>);
+ Expect.isTrue(m.remove is RemoveFunctionType<int, int>);
// Perform a few more tests.
m.Tests();
« no previous file with comments | « tests/language/map_test.dart ('k') | tests/language/ordered_maps_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698