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); |
} |