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

Unified Diff: tests/language_strong/osr_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/osr_test.dart
diff --git a/tests/language_strong/osr_test.dart b/tests/language_strong/osr_test.dart
index 6d31b85240bc573b6d716b185020ce7f9adf0c33..9cc5898c5b8f189fdc7f42b96a66beede4206e62 100644
--- a/tests/language_strong/osr_test.dart
+++ b/tests/language_strong/osr_test.dart
@@ -9,34 +9,33 @@ import "package:expect/expect.dart";
List create([int length]) {
return new MyList(length);
-}
+}
main() {
- test(create);
+ test(create);
}
-
class MyList<E> extends ListBase<E> {
List<E> _list;
-
- MyList([int length]): _list = (length==null ? new List() : new List(length));
-
+
+ MyList([int length])
+ : _list = (length == null ? new List() : new List(length));
+
E operator [](int index) => _list[index];
void operator []=(int index, E value) {
- _list[index]=value;
+ _list[index] = value;
}
int get length => _list.length;
void set length(int newLength) {
- _list.length=newLength;
+ _list.length = newLength;
}
}
-
test(List create([int length])) {
- sort_A01_t02_test(create);
+ sort_A01_t02_test(create);
}
// From library co19 sort_A01_t02.
@@ -57,7 +56,7 @@ sort_A01_t02_test(List create([int length])) {
prevLength = length;
List a = create(length);
List expected = create(length);
- for(int i = 0; i < length; ++i) {
+ for (int i = 0; i < length; ++i) {
expected[i] = i;
a[i] = i;
}
@@ -79,18 +78,18 @@ sort_A01_t02_test(List create([int length])) {
void permute(int n) {
if (n == 1) {
check();
- }
- else {
+ } else {
for (int i = 0; i < n; i++) {
- permute(n-1);
+ permute(n - 1);
if (n % 2 == 1) {
- swap(0, n-1);
+ swap(0, n - 1);
} else {
- swap(i, n-1);
+ swap(i, n - 1);
}
}
}
} //void permute
+
permute(length);
} //for i in 0..length
} // test

Powered by Google App Engine
This is Rietveld 408576698