| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |