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

Side by Side Diff: tests/standalone/src/StringStreamTest.dart

Issue 8772008: Add line handler to string stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « runtime/bin/string_stream.dart ('k') | tools/testing/dart/status_file_parser.dart » ('j') | 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) 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 class ListInputStream implements InputStream { 5 class ListInputStream implements InputStream {
6 List<int> read() { 6 List<int> read() {
7 var result = _data; 7 var result = _data;
8 _data = null; 8 _data = null;
9 return result; 9 return result;
10 } 10 }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 Expect.equals(null, line); 176 Expect.equals(null, line);
177 Expect.equals(true, stream.closed); 177 Expect.equals(true, stream.closed);
178 stage++; 178 stage++;
179 } 179 }
180 } 180 }
181 181
182 void streamClosed() { 182 void streamClosed() {
183 Expect.equals(4, stage); 183 Expect.equals(4, stage);
184 } 184 }
185 185
186 stream.dataHandler = stringData; 186 stream.lineHandler = stringData;
187 stream.closeHandler = streamClosed; 187 stream.closeHandler = streamClosed;
188 s.write("Line1\nLine2\r\nLine3\rLi".charCodes()); 188 s.write("Line1\nLine2\r\nLine3\rLi".charCodes());
189 Expect.equals(4, stage); 189 Expect.equals(4, stage);
190 } 190 }
191 191
192 main() { 192 main() {
193 testUtf8(); 193 testUtf8();
194 testLatin1(); 194 testLatin1();
195 testAscii(); 195 testAscii();
196 testReadLine1(); 196 testReadLine1();
197 testReadLine2(); 197 testReadLine2();
198 } 198 }
OLDNEW
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | tools/testing/dart/status_file_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698