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

Unified Diff: tests/language_strong/abstract_method_test.dart

Issue 2984443003: Migrate the language tests up to arithmetic_test. (Closed)
Patch Set: generic_methods_generic_function_result_test isn't working on DDC yet. Created 3 years, 5 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
Index: tests/language_strong/abstract_method_test.dart
diff --git a/tests/language_strong/abstract_method_test.dart b/tests/language_strong/abstract_method_test.dart
deleted file mode 100644
index 05370d28d31f8fd4e4d061541a152250f1d27c5e..0000000000000000000000000000000000000000
--- a/tests/language_strong/abstract_method_test.dart
+++ /dev/null
@@ -1,45 +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.
-
-import "package:expect/expect.dart";
-
-// Checks that abstract instance methods are correctly resolved.
-
-int get length => throw "error: top-level getter called";
-set height(x) {
- throw "error: top-level setter called";
-}
-
-width() {
- throw "error: top-level function called";
-}
-
-abstract class A {
- int get length; // Abstract instance getter.
- set height(int x); // Abstract instance setter.
- int width(); // Abstract instance method.
-
- // Must resolve to non-abstract length getter in subclass.
- get useLength => length;
- // Must resolve to non-abstract height setter in subclass.
- setHeight(x) => height = x;
- // Must resolve to non-abstract width() method in subclass.
- useWidth() => width();
-}
-
-class A1 extends A {
- int length; // Implies a length getter.
- int height; // Implies a height setter.
- int width() => 345;
- A1(this.length);
-}
-
-main() {
- var a = new A1(123);
- Expect.equals(123, a.useLength);
- a.setHeight(234);
- Expect.equals(234, a.height);
- Expect.equals(345, a.useWidth());
- print([a.useLength, a.height, a.useWidth()]);
-}
« no previous file with comments | « tests/language_strong/abstract_getter2_test.dart ('k') | tests/language_strong/abstract_object_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698