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

Unified Diff: tests/language/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/super_operator_test.dart
diff --git a/tests/language/super_operator_test.dart b/tests/language/super_operator_test.dart
index bde7fc9f4130a351629487b4e009cd0b834bfa19..bce75f71ee48bce890fc8b9dee61cf0f3358497f 100644
--- a/tests/language/super_operator_test.dart
+++ b/tests/language/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.
- 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