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

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

Issue 14166002: dart:io | Add additional test of directory listing of broken links. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove stray print statement. Created 7 years, 8 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 | « no previous file | no next file » | 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) 2013, 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 import "dart:isolate"; 8 import "dart:isolate";
9 9
10 // Test the dart:io Link class. 10 // Test the dart:io Link class.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 }, 126 },
127 onDone: () { 127 onDone: () {
128 for (var v in expected.values) { 128 for (var v in expected.values) {
129 Expect.equals('Found', v); 129 Expect.equals('Found', v);
130 } 130 }
131 f.complete(null); 131 f.complete(null);
132 }); 132 });
133 } 133 }
134 } 134 }
135 Future.wait(futures).then((_) { 135 Future.wait(futures).then((_) {
136 new Directory(target).deleteSync(recursive: true);
137 for (bool recursive in [true, false]) {
138 for (bool followLinks in [true, false]) {
139 var result = baseDir.listSync(recursive: recursive,
140 followLinks: followLinks);
141 Expect.equals(1, result.length);
142 Expect.isTrue(result[0] is Link);
143 }
144 }
136 baseDir.deleteSync(recursive: true); 145 baseDir.deleteSync(recursive: true);
137 }); 146 });
138 } 147 }
139 148
140 testCreateLoopingLink() { 149 testCreateLoopingLink() {
141 Path base = new Path(new Directory('').createTempSync().path); 150 Path base = new Path(new Directory('').createTempSync().path);
142 new Directory.fromPath(base.append('a/b/c')).create(recursive: true) 151 new Directory.fromPath(base.append('a/b/c')).create(recursive: true)
143 .then((_) => 152 .then((_) =>
144 new Link.fromPath(base.append('a/b/c/d')) 153 new Link.fromPath(base.append('a/b/c/d'))
145 .create(base.append('a/b').toNativePath())) 154 .create(base.append('a/b').toNativePath()))
(...skipping 15 matching lines...) Expand all
161 .list(recursive: true, followLinks: true) 170 .list(recursive: true, followLinks: true)
162 .last) 171 .last)
163 .then((_) => 172 .then((_) =>
164 new Directory.fromPath(base).delete(recursive: true)); 173 new Directory.fromPath(base).delete(recursive: true));
165 } 174 }
166 175
167 main() { 176 main() {
168 testCreateSync(); 177 testCreateSync();
169 testCreateLoopingLink(); 178 testCreateLoopingLink();
170 } 179 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698