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