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

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

Issue 9546003: Add method available to StringInputStream (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
« runtime/bin/input_stream.dart ('K') | « 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 7953723cde26790f4c19366d048d7d72370e8582..243b5e3d4004c2fa57af4af3e2b0b81326e9c6ac 100644
--- a/tests/standalone/src/io/StringStreamTest.dart
+++ b/tests/standalone/src/io/StringStreamTest.dart
@@ -107,19 +107,25 @@ void testReadLine2() {
void stringData() {
var line;
if (stage == 0) {
+ Expect.equals(21, stream.available());
line = stream.readLine();
Expect.equals("Line1", line);
+ Expect.equals(15, stream.available());
line = stream.readLine();
Expect.equals("Line2", line);
+ Expect.equals(8, stream.available());
line = stream.readLine();
Expect.equals("Line3", line);
line = stream.readLine();
+ Expect.equals(2, stream.available());
Expect.equals(null, line);
stage++;
s.write("ne4\n".charCodes());
} else if (stage == 1) {
+ Expect.equals(6, stream.available());
line = stream.readLine();
Expect.equals("Line4", line);
+ Expect.equals(0, stream.available());
line = stream.readLine();
Expect.equals(null, line);
stage++;
@@ -127,16 +133,19 @@ void testReadLine2() {
} else if (stage == 2) {
// Expect 5 empty lines. As long as the stream is not closed the
// final \r cannot be interpreted as a end of line.
+ Expect.equals(8, stream.available());
for (int i = 0; i < 5; i++) {
line = stream.readLine();
Expect.equals("", line);
}
+ Expect.equals(1, stream.available());
line = stream.readLine();
Expect.equals(null, line);
stage++;
s.markEndOfStream();
} else if (stage == 3) {
// The final \r can now be interpreted as an end of line.
+ Expect.equals(1, stream.available());
line = stream.readLine();
Expect.equals("", line);
line = stream.readLine();
« runtime/bin/input_stream.dart ('K') | « runtime/bin/string_stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698