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

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

Issue 12314153: dart:io | Rename File.name to File.path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove stray line break. 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
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 main() { 7 main() {
8 if (Platform.operatingSystem != 'windows') return; 8 if (Platform.operatingSystem != 'windows') return;
9 var tempDir = new Directory('').createTempSync(); 9 var tempDir = new Directory('').createTempSync();
10 var funkyDir = new Directory("${tempDir.path}/å"); 10 var funkyDir = new Directory("${tempDir.path}/å");
11 funkyDir.createSync(); 11 funkyDir.createSync();
12 var funkyFile = new File('${funkyDir.path}/funky.bat'); 12 var funkyFile = new File('${funkyDir.path}/funky.bat');
13 funkyFile.writeAsStringSync(""" 13 funkyFile.writeAsStringSync("""
14 @echo off 14 @echo off
15 set SCRIPTDIR=%~dp0 15 set SCRIPTDIR=%~dp0
16 %1 %2 16 %1 %2
17 """); 17 """);
18 var options = new Options(); 18 var options = new Options();
19 var dart = options.executable; 19 var dart = options.executable;
20 var scriptDir = new Path(options.script).directoryPath; 20 var scriptDir = new Path(options.script).directoryPath;
21 var script = scriptDir.append('windows_environment_script.dart'); 21 var script = scriptDir.append('windows_environment_script.dart');
22 Process.run('cmd', 22 Process.run('cmd',
23 ['/c', funkyFile.name, dart, script.toNativePath()]).then((p) { 23 ['/c', funkyFile.path, dart, script.toNativePath()]).then((p) {
24 Expect.equals(0, p.exitCode); 24 Expect.equals(0, p.exitCode);
25 tempDir.deleteSync(recursive: true); 25 tempDir.deleteSync(recursive: true);
26 }); 26 });
27 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698