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

Side by Side Diff: tests/standalone/io/process_non_ascii_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 import 'dart:isolate'; 6 import 'dart:isolate';
7 7
8 main() { 8 main() {
9 var port = new ReceivePort(); 9 var port = new ReceivePort();
10 var executable = new File(new Options().executable).fullPathSync(); 10 var executable = new File(new Options().executable).fullPathSync();
11 var tempDir = new Directory('').createTempSync(); 11 var tempDir = new Directory('').createTempSync();
12 var nonAsciiDir = new Directory('${tempDir.path}/æøå'); 12 var nonAsciiDir = new Directory('${tempDir.path}/æøå');
13 nonAsciiDir.createSync(); 13 nonAsciiDir.createSync();
14 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart'); 14 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart');
15 nonAsciiFile.writeAsStringSync( 15 nonAsciiFile.writeAsStringSync(
16 """ 16 """
17 import 'dart:io'; 17 import 'dart:io';
18 18
19 main() { 19 main() {
20 Expect.equals('æøå', new File('æøå.txt').readAsStringSync()); 20 Expect.equals('æøå', new File('æøå.txt').readAsStringSync());
21 } 21 }
22 """); 22 """);
23 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt'); 23 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt');
24 nonAsciiTxtFile.writeAsStringSync('æøå'); 24 nonAsciiTxtFile.writeAsStringSync('æøå');
25 var options = new ProcessOptions(); 25 var options = new ProcessOptions();
26 options.workingDirectory = nonAsciiDir.path; 26 options.workingDirectory = nonAsciiDir.path;
27 var script = nonAsciiFile.name; 27 var script = nonAsciiFile.path;
28 Process.run(executable, [script], options).then((result) { 28 Process.run(executable, [script], options).then((result) {
29 Expect.equals(0, result.exitCode); 29 Expect.equals(0, result.exitCode);
30 tempDir.deleteSync(recursive: true); 30 tempDir.deleteSync(recursive: true);
31 port.close(); 31 port.close();
32 }); 32 });
33 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698