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

Unified Diff: tests/standalone/io/windows_environment_test.dart

Issue 11529008: Fix extraction of environment variables on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/windows_environment_test.dart
diff --git a/tests/standalone/io/windows_environment_test.dart b/tests/standalone/io/windows_environment_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..34dc2a2e5181b74f6800ccd0a6503784ebda9dd8
--- /dev/null
+++ b/tests/standalone/io/windows_environment_test.dart
@@ -0,0 +1,27 @@
+// 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.fromNative(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);
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698