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

Side by Side Diff: tests/lib/async/stream_event_transform_test.dart

Issue 12086042: Fix code to not hit bug in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 library stream_event_transform_test;
6
5 import 'dart:async'; 7 import 'dart:async';
6 import '../../../pkg/unittest/lib/unittest.dart'; 8 import '../../../pkg/unittest/lib/unittest.dart';
7 import 'event_helper.dart'; 9 import 'event_helper.dart';
8 10
9 void handleData(int data, StreamSink<int> sink) { 11 void handleData(int data, StreamSink<int> sink) {
10 sink.signalError(new AsyncError("$data")); 12 sink.signalError(new AsyncError("$data"));
11 sink.add(data + 1); 13 sink.add(data + 1);
12 } 14 }
15
13 void handleError(AsyncError e, StreamSink<int> sink) { 16 void handleError(AsyncError e, StreamSink<int> sink) {
14 String value = e.error; 17 String value = e.error;
15 int data = int.parse(value); 18 int data = int.parse(value);
16 sink.add(data); 19 sink.add(data);
17 sink.signalError(new AsyncError("${data + 1}")); 20 sink.signalError(new AsyncError("${data + 1}"));
18 } 21 }
19 22
20 void handleDone(StreamSink<int> sink) { 23 void handleDone(StreamSink<int> sink) {
21 sink.add(99); 24 sink.add(99);
22 sink.close(); 25 sink.close();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 handleData: handleData, 71 handleData: handleData,
69 handleError: handleError, 72 handleError: handleError,
70 handleDone: handleDone 73 handleDone: handleDone
71 ))); 74 )));
72 actual.onDone(() { 75 actual.onDone(() {
73 Expect.listEquals(expected.events, actual.events); 76 Expect.listEquals(expected.events, actual.events);
74 }); 77 });
75 input.replay(c); 78 input.replay(c);
76 } 79 }
77 } 80 }
OLDNEW
« sdk/lib/async/stream_pipe.dart ('K') | « sdk/lib/async/stream_pipe.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698