| Index: tests/standalone/src/FileInputStreamTest.dart
|
| diff --git a/tests/standalone/src/FileInputStreamTest.dart b/tests/standalone/src/FileInputStreamTest.dart
|
| index a61ac68987c8100e018226d380ab2d394e9e53f6..af5fea01800560f483226fd903dd40fba54085e7 100644
|
| --- a/tests/standalone/src/FileInputStreamTest.dart
|
| +++ b/tests/standalone/src/FileInputStreamTest.dart
|
| @@ -8,10 +8,10 @@
|
| String getFilename(String path) =>
|
| new File(path).existsSync() ? path : '../' + path;
|
|
|
| -main() {
|
| - String fName = getFilename("tests/standalone/src/readuntil_test.dat");
|
| +void testStringInputStream() {
|
| + String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
|
| // File contains "Hello Dart\nwassup!"
|
| - File file = new File(fName);
|
| + File file = new File(fileName);
|
| file.openSync();
|
| StringInputStream x = new StringInputStream(file.openInputStream());
|
| String line = x.readLine();
|
| @@ -20,3 +20,27 @@ main() {
|
| line = x.readLine();
|
| Expect.equals("wassup!", line);
|
| }
|
| +
|
| +void testChunkedInputStream() {
|
| + String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
|
| + // File contains 19 bytes ("Hello Dart\nwassup!")
|
| + File file = new File(fileName);
|
| + file.openSync();
|
| + ChunkedInputStream x = new ChunkedInputStream(file.openInputStream());
|
| + x.chunkSize = 9;
|
| + List<int> chunk = x.read();
|
| + Expect.equals(9, chunk.length);
|
| + file.closeSync();
|
| + x.chunkSize = 5;
|
| + chunk = x.read();
|
| + Expect.equals(5, chunk.length);
|
| + chunk = x.read();
|
| + Expect.equals(5, chunk.length);
|
| + chunk = x.read();
|
| + Expect.equals(null, chunk);
|
| +}
|
| +
|
| +main() {
|
| + testStringInputStream();
|
| + testChunkedInputStream();
|
| +}
|
|
|