| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Testing FileInputStream, VM-only, standalone test. | 4 // Testing file input stream, VM-only, standalone test. |
| 5 | 5 |
| 6 // Helper method to be able to run the test from the runtime | 6 // Helper method to be able to run the test from the runtime |
| 7 // directory, or the top directory. | 7 // directory, or the top directory. |
| 8 String getFilename(String path) => | 8 String getFilename(String path) => |
| 9 new File(path).existsSync() ? path : '../' + path; | 9 new File(path).existsSync() ? path : '../' + path; |
| 10 | 10 |
| 11 void testStringInputStreamSync() { | 11 void testStringInputStreamSync() { |
| 12 String fileName = getFilename("tests/standalone/src/readuntil_test.dat"); | 12 String fileName = getFilename("tests/standalone/src/readuntil_test.dat"); |
| 13 // File contains "Hello Dart\nwassup!\n" | 13 // File contains "Hello Dart\nwassup!\n" |
| 14 File file = new File(fileName); | 14 File file = new File(fileName); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 main() { | 81 main() { |
| 82 testStringInputStreamSync(); | 82 testStringInputStreamSync(); |
| 83 testInputStreamAsync(); | 83 testInputStreamAsync(); |
| 84 // Check the length of these files as both are text files where one | 84 // Check the length of these files as both are text files where one |
| 85 // is without a terminating line separator which can easily be added | 85 // is without a terminating line separator which can easily be added |
| 86 // back if accidentally opened in a text editor. | 86 // back if accidentally opened in a text editor. |
| 87 testStringInputStreamAsync("readline_test1.dat", 111); | 87 testStringInputStreamAsync("readline_test1.dat", 111); |
| 88 testStringInputStreamAsync("readline_test2.dat", 114); | 88 testStringInputStreamAsync("readline_test2.dat", 114); |
| 89 testChunkedInputStream(); | 89 testChunkedInputStream(); |
| 90 } | 90 } |
| OLD | NEW |