@@ -44,30 +44,27 @@ void testDartExecShouldNotBeInCurrentDir() {
44
44
}
45
45
46
46
void testShouldSucceedWithEmptyPathEnvironment () {
47
- var command = Platform .isWindows ? 'dir ' : 'ls' ;
47
+ var command = Platform .isWindows ? 'cmd ' : 'ls' ;
48
48
Process .runSync (command, [],
49
49
includeParentEnvironment: false ,
50
50
environment: {_SCRIPT_KEY : 'yes' , 'PATH' : '' });
51
51
}
52
52
53
53
void testShouldSucceedWithSourcePlatformExecutable () {
54
- //print('*** Running normally');
55
54
verify (Platform .executable);
56
55
}
57
56
58
57
void testExeSymLinked (Directory dir) {
59
58
var dirUri = new Uri .directory (dir.path);
60
59
var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
61
60
link.createSync (Platform .executable);
62
- //print('*** Creating a sym-link to the executable');
63
61
verify (link.path);
64
62
}
65
63
66
64
void testPathToDirWithExeSymLinked (Directory dir) {
67
65
var dirUri = new Uri .directory (dir.path);
68
66
var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
69
67
link.createSync (Platform .executable);
70
- //print('*** Path to a directory that contains a sym-link to dart bin');
71
68
verify ('dart_exe_link' , altPath: dir.path);
72
69
}
73
70
@@ -85,7 +82,6 @@ void testExeDirSymLinked(Directory dir) {
85
82
var linkedBin =
86
83
new Uri .directory (linkDirUri.toFilePath ()).resolve (platformExeName);
87
84
88
- //print('*** Running in a sym-linked directory');
89
85
verify (linkedBin.toFilePath ());
90
86
}
91
87
@@ -99,15 +95,13 @@ void testPathPointsToSymLinkedSDKPath(Directory dir) {
99
95
100
96
link.createSync (exeFile.parent.path);
101
97
102
- //print('*** Path points to a sym-linked SDK dir');
103
98
verify (platformExeName, altPath: link.path);
104
99
}
105
100
106
101
void testPathToSDKDir () {
107
102
var exeFile = new File (Platform .executable);
108
103
var binDirPath = exeFile.parent.path;
109
104
110
- //print('*** Running with PATH env set to environment - fixed in 16994 - thanks!');
111
105
verify (platformExeName, altPath: binDirPath);
112
106
}
113
107
@@ -135,10 +129,16 @@ void main() {
135
129
136
130
testDartExecShouldNotBeInCurrentDir ();
137
131
testShouldSucceedWithSourcePlatformExecutable (); /// 00: ok
138
- withTempDir (testExeSymLinked); /// 01: ok
132
+ // dart:io does not support linking to files in Windows.
133
+ if (! Platform .isWindows) {
134
+ withTempDir (testExeSymLinked); /// 01: ok
135
+ }
139
136
withTempDir (testExeDirSymLinked); /// 02: ok
140
137
testPathToSDKDir (); /// 03: ok
141
138
withTempDir (testPathPointsToSymLinkedSDKPath); /// 04: ok
142
- withTempDir (testPathToDirWithExeSymLinked); /// 05: ok
139
+ // dart:io does not support linking to files in Windows.
140
+ if (! Platform .isWindows) {
141
+ withTempDir (testPathToDirWithExeSymLinked); /// 05: ok
142
+ }
143
143
testShouldSucceedWithEmptyPathEnvironment (); /// 06: ok
144
144
}
0 commit comments