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

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

Issue 12217086: Change Directory.list to use the input path, and not resolve it to a full path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Finish the work on linux, macos, android. Created 7 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 6
7 7
8 createLink(String dst, String link, bool symbolic, void callback()) { 8 createLink(String dst, String link, bool symbolic, void callback()) {
9 var args = [ symbolic ? '-s' : '', dst, link ]; 9 var args = [ symbolic ? '-s' : '', dst, link ];
10 var script = 'tests/standalone/io/ln.sh'; 10 var script = 'tests/standalone/io/ln.sh';
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 var dirs = []; 129 var dirs = [];
130 for (var entry in temp.listSync(recursive:true)) { 130 for (var entry in temp.listSync(recursive:true)) {
131 if (entry is File) { 131 if (entry is File) {
132 files.add(entry.name); 132 files.add(entry.name);
133 } else { 133 } else {
134 Expect.isTrue(entry is Directory); 134 Expect.isTrue(entry is Directory);
135 dirs.add(entry.path); 135 dirs.add(entry.path);
136 } 136 }
137 } 137 }
138 Expect.equals(1, files.length); 138 Expect.equals(1, files.length);
139 Expect.isTrue(files[0].endsWith(x)); 139 Expect.isTrue(files[0].endsWith('$y${Platform.pathSeparator}x'));
140 Expect.equals(1, dirs.length); 140 Expect.equals(1, dirs.length);
141 Expect.isTrue(dirs[0].endsWith(y)); 141 Expect.isTrue(dirs[0].endsWith(y));
142 142
143 files = []; 143 files = [];
144 dirs = []; 144 dirs = [];
145 var lister = temp.list(recursive: true); 145 var lister = temp.list(recursive: true);
146 lister.onFile = (f) => files.add(f); 146 lister.onFile = (f) => files.add(f);
147 lister.onDir = (d) => dirs.add(d); 147 lister.onDir = (d) => dirs.add(d);
148 lister.onDone = (success) { 148 lister.onDone = (success) {
149 Expect.isTrue(success); 149 Expect.isTrue(success);
150 Expect.equals(1, files.length); 150 Expect.equals(1, files.length);
151 Expect.isTrue(files[0].endsWith(x)); 151 Expect.isTrue(files[0].endsWith('$y${Platform.pathSeparator}x'));
152 Expect.equals(1, dirs.length); 152 Expect.equals(1, dirs.length);
153 Expect.isTrue(dirs[0].endsWith(y)); 153 Expect.isTrue(dirs[0].endsWith(y));
154 temp.deleteSync(recursive: true); 154 temp.deleteSync(recursive: true);
155 temp2.deleteSync(recursive: true); 155 temp2.deleteSync(recursive: true);
156 }; 156 };
157 }); 157 });
158 } 158 }
159 159
160 160
161 testDirectoryListingBrokenLink() { 161 testDirectoryListingBrokenLink() {
(...skipping 27 matching lines...) Expand all
189 189
190 main() { 190 main() {
191 testFileExistsCreate(); 191 testFileExistsCreate();
192 testFileDelete(); 192 testFileDelete();
193 testFileWriteRead(); 193 testFileWriteRead();
194 testDirectoryExistsCreate(); 194 testDirectoryExistsCreate();
195 testDirectoryDelete(); 195 testDirectoryDelete();
196 testDirectoryListing(); 196 testDirectoryListing();
197 testDirectoryListingBrokenLink(); 197 testDirectoryListingBrokenLink();
198 } 198 }
OLDNEW
« runtime/bin/directory_linux.cc ('K') | « runtime/bin/directory_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698