blob: 1812c2563df93e160b26dab79eeb5f44b585414f [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "dart:io";
main() {
if (Platform.operatingSystem != 'windows') return;
var tempDir = new Directory('').createTempSync();
var funkyDir = new Directory("${tempDir.path}/å");
funkyDir.createSync();
var funkyFile = new File('${funkyDir.path}/funky.bat');
funkyFile.writeAsStringSync("""
@echo off
set SCRIPTDIR=%~dp0
%1 %2
""");
var options = new Options();
var dart = options.executable;
var scriptDir = new Path(options.script).directoryPath;
var script = scriptDir.append('windows_environment_script.dart');
Process.run('cmd',
['/c', funkyFile.name, dart, script.toNativePath()]).then((p) {
Expect.equals(0, p.exitCode);
tempDir.deleteSync(recursive: true);
});
}