| Index: tests/standalone/src/io/StringStreamTest.dart
|
| diff --git a/tests/standalone/src/io/StringStreamTest.dart b/tests/standalone/src/io/StringStreamTest.dart
|
| index d2057481501c56383838a969c8e18c34933ac54b..97233313de0139e62d63224d3c06f9f1221e24db 100644
|
| --- a/tests/standalone/src/io/StringStreamTest.dart
|
| +++ b/tests/standalone/src/io/StringStreamTest.dart
|
| @@ -165,10 +165,40 @@ void testReadLine2() {
|
| s.write("Line1\nLine2\r\nLine3\rLi".charCodes());
|
| }
|
|
|
| +class TestException {
|
| + TestException();
|
| +}
|
| +
|
| +class ErrorInputStream implements InputStream {
|
| + ErrorInputStream();
|
| + List<int> read([int len]) => null;
|
| + int readInto(List<int> buffer, [int offset, int len]) => 0;
|
| + int available() => 0;
|
| + void pipe(OutputStream output, [bool close]){ }
|
| + void close() { }
|
| + bool get closed() => true;
|
| + void set onData(void callback()) { }
|
| + void set onClosed(void callback()) { }
|
| + void set onError(void callback(Exception e)) {
|
| + callback(new TestException());
|
| + }
|
| +}
|
| +
|
| +testErrorHandler() {
|
| + var errors = 0;
|
| + var stream = new StringInputStream(new ErrorInputStream());
|
| + stream.onError = (e) {
|
| + errors++;
|
| + Expect.isTrue(e is TestException);
|
| + };
|
| + Expect.equals(1, errors);
|
| +}
|
| +
|
| main() {
|
| testUtf8();
|
| testLatin1();
|
| testAscii();
|
| testReadLine1();
|
| testReadLine2();
|
| + testErrorHandler();
|
| }
|
|
|