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

Unified Diff: tests/standalone/src/FileInputStreamTest.dart

Issue 8318009: Update the streams interfaces (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 9 years, 2 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 | « tests/standalone/src/EchoServerStreamTest.dart ('k') | tests/standalone/src/FileTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileInputStreamTest.dart
diff --git a/tests/standalone/src/FileInputStreamTest.dart b/tests/standalone/src/FileInputStreamTest.dart
index 240b24803a5e40044534ccfe21710d925bb86b3e..d4dde8e6d38ea26eff02a8e1b67f894dac930103 100644
--- a/tests/standalone/src/FileInputStreamTest.dart
+++ b/tests/standalone/src/FileInputStreamTest.dart
@@ -3,13 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
// Testing FileInputStream, VM-only, standalone test.
-
-String callbackString = null;
-
-callback(List<int> buffer) {
- callbackString = new String.fromCharCodes(buffer);
-}
-
// Helper method to be able to run the test from the runtime
// directory, or the top directory.
String getFilename(String path) =>
@@ -17,23 +10,12 @@ String getFilename(String path) =>
main() {
String fName = getFilename("tests/standalone/src/readuntil_test.dat");
- // File contains "Hello Dart, wassup!"
+ // File contains "Hello Dart\nwassup!"
File file = new File(fName, false);
- FileInputStream x = new FileInputStream(file);
- x.readUntil("Dart".charCodes(), callback);
- file.close();
- Expect.stringEquals("Hello Dart", callbackString);
-
- callbackString = null;
- file = new File(fName, false);
- x = new FileInputStream(file);
- x.readUntil("Darty".charCodes(), callback);
- file.close();
- Expect.isNull(callbackString);
-
- file = new File(fName, false);
- x = new FileInputStream(file);
- x.readUntil("wassup!".charCodes(), callback);
+ StringInputStream x = new StringInputStream(file.inputStream);
+ String line = x.readLine();
+ Expect.equals("Hello Dart", line);
file.close();
- Expect.stringEquals("Hello Dart, wassup!", callbackString);
+ line = x.readLine();
+ Expect.equals("wassup!", line);
}
« no previous file with comments | « tests/standalone/src/EchoServerStreamTest.dart ('k') | tests/standalone/src/FileTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698