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

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

Issue 12328037: Add missing files from previous commit (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « sdk/lib/utf/utf_stream.dart ('k') | tests/standalone/io/http_client_connect_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6 import 'dart:isolate';
7
8 void main() {
9 // temp/
10 // a/
11 // file.txt
12 // b/
13 // a_link -> a
14 var d = new Directory("").createTempSync();
15 var a = new Directory("${d.path}/a");
16 a.createSync();
17
18 var b = new Directory("${d.path}/b");
19 b.createSync();
20
21 var f = new File("${d.path}/a/file.txt");
22 f.createSync();
23 Expect.isTrue(f.existsSync());
24
25 // Create a symlink (or junction on Windows) from
26 // temp/b/a_link to temp/a.
27 var cmd = "ln";
28 var args = ['-s', "${d.path}/b/a_link", "${d.path}/a"];
29
30 if (Platform.operatingSystem == "windows") {
31 cmd = "cmd";
32 args = ["/c", "mklink", "/j", "${d.path}\\b\\a_link", "${d.path}\\a"];
33 }
34
35 var keepAlive = new ReceivePort();
36
37 Process.run(cmd, args).then((_) {
38 // Delete the directory containing the junction.
39 b.deleteSync(recursive: true);
40
41 // We should not have recursed through a_link into a.
42 Expect.isTrue(f.existsSync());
43
44 // Clean up after ourselves.
45 d.deleteSync(recursive: true);
46
47 // Terminate now that we are done with everything.
48 keepAlive.close();
49 });
50 }
OLDNEW
« no previous file with comments | « sdk/lib/utf/utf_stream.dart ('k') | tests/standalone/io/http_client_connect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698