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

Side by Side Diff: pkg/async/test/result_test.dart

Issue 294973010: Fix typo in fix. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:async"; 5 import "dart:async";
6 import "dart:collection"; 6 import "dart:collection";
7 import "package:async/result.dart"; 7 import "package:async/result.dart";
8 import "package:unittest/unittest.dart"; 8 import "package:unittest/unittest.dart";
9 9
10 void main() { 10 void main() {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 c.add(new Result.value(42)); 229 c.add(new Result.value(42));
230 c.add(new Result.error("BAD", stack)); 230 c.add(new Result.error("BAD", stack));
231 c.add(new Result.value(37)); 231 c.add(new Result.value(37));
232 c.close(); 232 c.close();
233 }); 233 });
234 234
235 235
236 test("flatten error 1", () { 236 test("flatten error 1", () {
237 Result<int> error = new Result<int>.error("BAD", stack); 237 Result<int> error = new Result<int>.error("BAD", stack);
238 Result<int> flattened = 238 Result<int> flattened =
239 Result.flatten(new Result<Result<int>>.error(error)); 239 Result.flatten(new Result<Result<int>>.error("BAD", stack));
240 expectResult(flattened, error); 240 expectResult(flattened, error);
241 }); 241 });
242 242
243 test("flatten error 2", () { 243 test("flatten error 2", () {
244 Result<int> error = new Result<int>.error("BAD", stack); 244 Result<int> error = new Result<int>.error("BAD", stack);
245 Result<Result<int>> result = new Result<Result<int>>.value(error); 245 Result<Result<int>> result = new Result<Result<int>>.value(error);
246 Result<int> flattened = Result.flatten(result); 246 Result<int> flattened = Result.flatten(result);
247 expectResult(flattened, error); 247 expectResult(flattened, error);
248 }); 248 });
249 249
(...skipping 27 matching lines...) Expand all
277 void add(T value) { onData(value); } 277 void add(T value) { onData(value); }
278 void addError(error, [StackTrace stack]) { onError(error, stack); } 278 void addError(error, [StackTrace stack]) { onError(error, stack); }
279 void close() { onDone(); } 279 void close() { onDone(); }
280 280
281 static void _nullData(value) { fail("Unexpected sink add: $value"); } 281 static void _nullData(value) { fail("Unexpected sink add: $value"); }
282 static void _nullError(e, StackTrace s) { 282 static void _nullError(e, StackTrace s) {
283 fail("Unexpected sink addError: $e"); 283 fail("Unexpected sink addError: $e");
284 } 284 }
285 static void _nullDone() { fail("Unepxected sink close"); } 285 static void _nullDone() { fail("Unepxected sink close"); }
286 } 286 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698