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

Unified Diff: tests/language_strong/super_operator_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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
Index: tests/language_strong/super_operator_test.dart
diff --git a/tests/language_strong/super_operator_test.dart b/tests/language_strong/super_operator_test.dart
index 5cfbdde4254df95008c41917498f24b36ad221b2..3e25610a68ee0dee83e9228874b0b86e2d811a67 100644
--- a/tests/language_strong/super_operator_test.dart
+++ b/tests/language_strong/super_operator_test.dart
@@ -5,35 +5,33 @@
import "package:expect/expect.dart";
-
class A {
String val = "";
List things;
A() : things = ['D', 'a', 'r', 't', 42];
- operator + (String s) {
+ operator +(String s) {
val = "${val}${s}";
return this;
}
- operator [] (i) {
+ operator [](i) {
return things[i];
}
- operator []= (i, val) {
+ operator []=(i, val) {
return things[i] = val;
}
}
-
class B extends A {
- operator + (String s) {
- super + ("${s}${s}"); // Call A.operator+(this, "${s}${s}").
+ operator +(String s) {
+ super + ("${s}${s}"); // Call A.operator+(this, "${s}${s}").
return this;
}
- operator [] (i) {
+ operator [](i) {
var temp = super[i];
if (temp is String) {
return "$temp$temp";
@@ -41,38 +39,34 @@ class B extends A {
return temp + temp;
}
- operator []= (i, val) {
+ operator []=(i, val) {
// Make sure the index expression is only evaluated
// once in the presence of a compound assignment.
return super[i++] += val;
}
-
}
-
class Autobianchi {
g() => super[0];
}
-
testRegression6403() {
// Do not crash, throw exception instead
new Autobianchi().g();
}
-
-main () {
+main() {
var a = new A();
- a = a + "William"; // operator + of class A.
+ a = a + "William"; // operator + of class A.
Expect.equals("William", a.val);
- Expect.equals("r", a[2]); // operator [] of class A.
+ 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.
+ Expect.equals("rr", a[2]); // operator [] of class B.
- a[4] = 1; // operator []= of class B.
+ a[4] = 1; // operator []= of class B.
Expect.equals(43, a.things[4]);
Expect.equals(86, a[4]);

Powered by Google App Engine
This is Rietveld 408576698