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

Unified Diff: test/isolaterunner_test.dart

Issue 955053002: adding codereview file, formatting, adding gitignore (Closed) Base URL: https://github.com/dart-lang/isolate.git@master
Patch Set: Created 5 years, 10 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: test/isolaterunner_test.dart
diff --git a/test/isolaterunner_test.dart b/test/isolaterunner_test.dart
index 4b98b587faf42ec74190340b243169eb57e9e9a0..d6dc774389a8cc7c04cee4ab58ce4b88659b4177 100644
--- a/test/isolaterunner_test.dart
+++ b/test/isolaterunner_test.dart
@@ -35,25 +35,24 @@ Future testCreateRunClose() {
Future testSeparateIsolates() {
// Check that each isolate has its own _global variable.
- return Future.wait(new Iterable.generate(2, (_) => IsolateRunner.spawn()))
- .then((runners) {
- Future runAll(action(IsolateRunner runner, int index)) {
- var indices = new Iterable.generate(runners.length);
- return Future.wait(indices.map((i) => action(runners[i], i)));
- }
+ return Future
+ .wait(new Iterable.generate(2, (_) => IsolateRunner.spawn()))
+ .then((runners) {
+ Future runAll(action(IsolateRunner runner, int index)) {
Lasse Reichstein Nielsen 2015/02/26 10:59:15 Indent body by four more.
+ var indices = new Iterable.generate(runners.length);
+ return Future.wait(indices.map((i) => action(runners[i], i)));
+ }
- return runAll((runner, i) => runner.run(setGlobal, i + 1))
- .then((values) {
- expect(values, [1, 2]);
- expect(_global, null);
- return runAll((runner, _) => runner.run(getGlobal, null));
- })
- .then((values) {
- expect(values, [1, 2]);
- expect(_global, null);
- return runAll((runner, _) => runner.close());
- });
+ return runAll((runner, i) => runner.run(setGlobal, i + 1)).then((values) {
Lasse Reichstein Nielsen 2015/02/26 10:59:15 This one is acceptable, but I still think it's bet
+ expect(values, [1, 2]);
+ expect(_global, null);
+ return runAll((runner, _) => runner.run(getGlobal, null));
+ }).then((values) {
+ expect(values, [1, 2]);
+ expect(_global, null);
+ return runAll((runner, _) => runner.close());
});
+ });
}
void testIsolateFunctions() {

Powered by Google App Engine
This is Rietveld 408576698