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

Unified Diff: tests/standalone/src/io/StringStreamTest.dart

Issue 9864051: Fix typo that has crept into string input stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698