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

Unified Diff: tests/standalone/src/FileTest.dart

Issue 9465007: Fix file tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileTest.dart
diff --git a/tests/standalone/src/FileTest.dart b/tests/standalone/src/FileTest.dart
index bf72b191a9e2a8c0a088d0e4a47384e1d3b87fcc..e90244a9bdfa4ca63d9dcb2d2d98a27b4e3d5fe8 100644
--- a/tests/standalone/src/FileTest.dart
+++ b/tests/standalone/src/FileTest.dart
@@ -915,7 +915,7 @@ class FileTest {
f.readAsTextHandler = (text) {
Expect.isTrue(text.endsWith("42 bytes."));
Expect.equals(42, text.length);
- var name = getFilename("tests/standalone/src/read_as_text.dat");
+ var name = getDataFilename("tests/standalone/src/read_as_text.dat");
var f = new File(name);
f.errorHandler = (e) => Expect.fail("No errors expected");
f.readAsText('UTF-8');
@@ -948,7 +948,7 @@ class FileTest {
var text = new File(name).readAsTextSync();
Expect.isTrue(text.endsWith("42 bytes."));
Expect.equals(42, text.length);
- name = getFilename("tests/standalone/src/read_as_text.dat");
+ name = getDataFilename("tests/standalone/src/read_as_text.dat");
text = new File(name).readAsTextSync();
Expect.equals(6, text.length);
var expected = [955, 120, 46, 32, 120, 10];
@@ -986,7 +986,7 @@ class FileTest {
var line = lines[0];
Expect.isTrue(line.endsWith("42 bytes."));
Expect.equals(42, line.length);
- name = getFilename("tests/standalone/src/readline_test1.dat");
+ name = getDataFilename("tests/standalone/src/readline_test1.dat");
lines = new File(name).readAsLinesSync();
Expect.equals(10, lines.length);
}
@@ -1064,6 +1064,9 @@ class FileTest {
static String getFilename(String path) =>
new File(path).existsSync() ? path : 'runtime/' + path;
+ static String getDataFilename(String path) =>
+ new File(path).existsSync() ? path : '../' + path;
+
// Main test entrypoint.
static testMain() {
testRead();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698