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

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

Issue 899243002: Make standalone tests not dependent on current working directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/file_input_stream_test.dart
diff --git a/tests/standalone/io/file_input_stream_test.dart b/tests/standalone/io/file_input_stream_test.dart
index 86cb355aa403dadd83db57e8cb19528e53babeff..25cf360cb19fd3b567c846bec13ff0f96127ffaf 100644
--- a/tests/standalone/io/file_input_stream_test.dart
+++ b/tests/standalone/io/file_input_stream_test.dart
@@ -11,8 +11,12 @@ import "package:expect/expect.dart";
// Helper method to be able to run the test from the runtime
// directory, or the top directory.
-String getFilename(String path) =>
- new File(path).existsSync() ? path : '../$path';
+String getFilename(String path) {
+ var testPath = Platform.script.resolve('../../../$path');
+ return new File.fromUri(testPath).existsSync()
+ ? testPath.toFilePath()
+ : Platform.script.resolve('../../../runtime/$path').toFilePath();
+}
void testStringLineSplitter() {
String fileName = getFilename("tests/standalone/io/readuntil_test.dat");

Powered by Google App Engine
This is Rietveld 408576698