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

Side by Side Diff: tests/standalone/io/file_system_links_test.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments Created 7 years, 9 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
« no previous file with comments | « tests/standalone/io/file_output_stream_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 4
5 import "dart:io"; 5 import "dart:io";
6 import "dart:isolate"; 6 import "dart:isolate";
7 7
8 8
9 createLink(String dst, String link, bool symbolic, void callback()) { 9 createLink(String dst, String link, bool symbolic, void callback()) {
10 var args = [ symbolic ? '-s' : '', dst, link ]; 10 var args = [ symbolic ? '-s' : '', dst, link ];
11 var script = 'tests/standalone/io/ln.sh'; 11 var script = 'tests/standalone/io/ln.sh';
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 99
100 testFileWriteRead() { 100 testFileWriteRead() {
101 var temp = new Directory('').createTempSync(); 101 var temp = new Directory('').createTempSync();
102 var x = '${temp.path}${Platform.pathSeparator}x'; 102 var x = '${temp.path}${Platform.pathSeparator}x';
103 var y = '${temp.path}${Platform.pathSeparator}y'; 103 var y = '${temp.path}${Platform.pathSeparator}y';
104 new File(x).createSync(); 104 new File(x).createSync();
105 createLink(x, y, true, () { 105 createLink(x, y, true, () {
106 var data = "asdf".codeUnits; 106 var data = "asdf".codeUnits;
107 var output = new File(y).openWrite(FileMode.WRITE); 107 var output = new File(y).openWrite(mode: FileMode.WRITE);
108 output.add(data); 108 output.writeBytes(data);
109 output.close(); 109 output.close();
110 output.done.then((_) { 110 output.done.then((_) {
111 var read = new File(y).readAsBytesSync(); 111 var read = new File(y).readAsBytesSync();
112 Expect.listEquals(data, read); 112 Expect.listEquals(data, read);
113 var read2 = new File(x).readAsBytesSync(); 113 var read2 = new File(x).readAsBytesSync();
114 Expect.listEquals(data, read2); 114 Expect.listEquals(data, read2);
115 temp.deleteSync(recursive: true); 115 temp.deleteSync(recursive: true);
116 }); 116 });
117 }); 117 });
118 } 118 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 main() { 242 main() {
243 testFileExistsCreate(); 243 testFileExistsCreate();
244 testFileDelete(); 244 testFileDelete();
245 testFileWriteRead(); 245 testFileWriteRead();
246 testDirectoryExistsCreate(); 246 testDirectoryExistsCreate();
247 testDirectoryDelete(); 247 testDirectoryDelete();
248 testDirectoryListing(); 248 testDirectoryListing();
249 testDirectoryListingBrokenLink(); 249 testDirectoryListingBrokenLink();
250 } 250 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_output_stream_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698