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

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

Issue 2423593002: Add test directive to include other files used by a test in its compiled output directory. (Closed)
Patch Set: Created 4 years, 2 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 | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25cf360cb19fd3b567c846bec13ff0f96127ffaf..88615a664b701258deb53f3214099709ad4817d3 100644
--- a/tests/standalone/io/file_input_stream_test.dart
+++ b/tests/standalone/io/file_input_stream_test.dart
@@ -2,6 +2,10 @@
// 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.
// Testing file input stream, VM-only, standalone test.
+//
+// OtherResources=readuntil_test.dat
+// OtherResources=readline_test1.dat
+// OtherResources=readline_test2.dat
import "dart:convert";
import "dart:io";
@@ -9,17 +13,12 @@ import "dart:io";
import "package:async_helper/async_helper.dart";
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) {
- var testPath = Platform.script.resolve('../../../$path');
- return new File.fromUri(testPath).existsSync()
- ? testPath.toFilePath()
- : Platform.script.resolve('../../../runtime/$path').toFilePath();
+ return Platform.script.resolve(path).toFilePath();
}
void testStringLineSplitter() {
- String fileName = getFilename("tests/standalone/io/readuntil_test.dat");
+ String fileName = getFilename("readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
File file = new File(fileName);
int linesRead = 0;
@@ -41,7 +40,7 @@ void testStringLineSplitter() {
void testOpenStreamAsync() {
asyncStart();
- String fileName = getFilename("tests/standalone/io/readuntil_test.dat");
+ String fileName = getFilename("readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
var expected = "Hello Dart\nwassup!\n".codeUnits;
var byteCount = 0;
@@ -234,7 +233,7 @@ void testInputStreamBadOffset() {
void testStringLineSplitterEnding(String name, int length) {
- String fileName = getFilename("tests/standalone/io/$name");
+ String fileName = getFilename(name);
// File contains 10 lines.
File file = new File(fileName);
Expect.equals(length, file.lengthSync());
« no previous file with comments | « no previous file | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698