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/ListOutputStreamTest.dart

Issue 9653026: Add writeString method to OutputStream (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
Index: tests/standalone/src/io/ListOutputStreamTest.dart
diff --git a/tests/standalone/src/io/ListOutputStreamTest.dart b/tests/standalone/src/io/ListOutputStreamTest.dart
index cb6ceacb9ebca1a59caf83dd4ed2ae7e4b271a4b..6b3562b5d708c52d1c89d3fd19f88e8aeb2422f8 100644
--- a/tests/standalone/src/io/ListOutputStreamTest.dart
+++ b/tests/standalone/src/io/ListOutputStreamTest.dart
@@ -85,9 +85,34 @@ void testListOutputStream2() {
donePort.receive((x,y) => donePort.close());
}
+void testListOutputStream3() {
+ OutputStream stream = new ListOutputStream();
+ ReceivePort donePort = new ReceivePort();
+ void onNoPendingWrites() {
+ stream.writeString("abcdABCD");
+ stream.writeString("abcdABCD", Encodings.UTF_8);
+ stream.writeString("abcdABCD", Encodings.ISO_8859_1);
+ stream.writeString("abcdABCD", Encodings.ASCII);
+ stream.writeString("æøå", Encodings.UTF_8);
+ stream.close();
+ }
+
+ void onClosed() {
+ var contents = stream.contents();
+ Expect.equals(38, contents.length);
+ donePort.toSendPort().send(null);
+ }
+
+ stream.onNoPendingWrites = onNoPendingWrites;
+ stream.onClosed = onClosed;
+
+ donePort.receive((x,y) => donePort.close());
+}
+
main() {
testEmptyListOutputStream1();
testEmptyListOutputStream2();
testListOutputStream1();
testListOutputStream2();
+ testListOutputStream3();
}

Powered by Google App Engine
This is Rietveld 408576698