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

Unified Diff: tests/language/src/SuperOperatorTest.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/SuperImplicitClosureTest.dart ('k') | tests/language/src/SuperSetterTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/SuperOperatorTest.dart
diff --git a/tests/language/src/SuperOperatorTest.dart b/tests/language/src/SuperOperatorTest.dart
deleted file mode 100644
index a0be547d50cecff9b408e497b6d8952fdf1f4103..0000000000000000000000000000000000000000
--- a/tests/language/src/SuperOperatorTest.dart
+++ /dev/null
@@ -1,65 +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.
-// Dart test for testing super operator calls
-
-
-class A {
- String val = "";
- List things;
-
- A() : things = ['D', 'a', 'r', 't', 42];
-
- operator + (String s) {
- val = "${val}${s}";
- return this;
- }
-
- operator [] (i) {
- return things[i];
- }
-
- operator []= (i, val) {
- return things[i] = val;
- }
-}
-
-
-class B extends A {
- operator + (String s) {
- super + ("${s}${s}"); // Call A.operator+(this, "${s}${s}").
- return this;
- }
-
- operator [] (i) {
- var temp = super[i];
- if (temp is String) {
- return "$temp$temp";
- }
- return temp + temp;
- }
-
- operator []= (i, val) {
- // Make sure the index expression is only evaluated
- // once in the presence of a compound assignment.
- return super[i++] += val;
- }
-
-}
-
-main () {
- var a = new A();
- a = a + "William"; // operator + of class A.
- Expect.equals("William", a.val);
- Expect.equals("r", a[2]); // operator [] of class A.
-
- a = new B();
- a += "Tell"; // operator + of class B.
- Expect.equals("TellTell", a.val);
- Expect.equals("rr", a[2]); // operator [] of class B.
-
- a[4] = 1; // operator []= of class B.
- Expect.equals(43, a.things[4]);
- Expect.equals(86, a[4]);
-
-}
« no previous file with comments | « tests/language/src/SuperImplicitClosureTest.dart ('k') | tests/language/src/SuperSetterTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698