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

Side by Side Diff: tests/standalone/src/FileInputStreamTest.dart

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 file input stream, VM-only, standalone test. 4 // Testing file input stream, VM-only, standalone test.
5 5
6 #import("dart:io");
7
6 // Helper method to be able to run the test from the runtime 8 // Helper method to be able to run the test from the runtime
7 // directory, or the top directory. 9 // directory, or the top directory.
8 String getFilename(String path) => 10 String getFilename(String path) =>
9 new File(path).existsSync() ? path : '../' + path; 11 new File(path).existsSync() ? path : '../' + path;
10 12
11 void testStringInputStreamSync() { 13 void testStringInputStreamSync() {
12 String fileName = getFilename("tests/standalone/src/readuntil_test.dat"); 14 String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
13 // File contains "Hello Dart\nwassup!\n" 15 // File contains "Hello Dart\nwassup!\n"
14 File file = new File(fileName); 16 File file = new File(fileName);
15 StringInputStream x = new StringInputStream(file.openInputStream()); 17 StringInputStream x = new StringInputStream(file.openInputStream());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 main() { 83 main() {
82 testStringInputStreamSync(); 84 testStringInputStreamSync();
83 testInputStreamAsync(); 85 testInputStreamAsync();
84 // Check the length of these files as both are text files where one 86 // 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 87 // is without a terminating line separator which can easily be added
86 // back if accidentally opened in a text editor. 88 // back if accidentally opened in a text editor.
87 testStringInputStreamAsync("readline_test1.dat", 111); 89 testStringInputStreamAsync("readline_test1.dat", 111);
88 testStringInputStreamAsync("readline_test2.dat", 114); 90 testStringInputStreamAsync("readline_test2.dat", 114);
89 testChunkedInputStream(); 91 testChunkedInputStream();
90 } 92 }
OLDNEW
« no previous file with comments | « tests/standalone/src/EchoServerTest.dart ('k') | tests/standalone/src/FileInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698