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

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

Issue 10984086: Fix standalone/io/file_invalid_arguments_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | dart/tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/standalone/io/file_invalid_arguments_test.dart
diff --git a/dart/tests/standalone/io/file_invalid_arguments_test.dart b/dart/tests/standalone/io/file_invalid_arguments_test.dart
index 674b789f4156c29fa6326b9b3f457e2b3acd287b..fc5c63ffd7de9e49bde8296b46d599ee64b2a938 100644
--- a/dart/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/dart/tests/standalone/io/file_invalid_arguments_test.dart
@@ -5,61 +5,6 @@
#import("dart:io");
class FileTest {
- static void testOpenInvalidArgs(name) {
- var file = new File(name);
- try {
- file.openSync();
- Expect.fail('exception expected');
- } catch (e) {
- Expect.isTrue(e is ArgumentError);
- }
-
- var openFuture = file.open(FileMode.READ);
- openFuture.handleException((e) {
- Expect.isTrue(e is ArgumentError);
- return true;
- });
- openFuture.then((opened) {
- Expect.fail('non-string name open');
- });
- }
-
- static void testExistsInvalidArgs(name) {
- var file = new File(name);
- try {
- file.existsSync();
- Expect.fail('exception expected');
- } catch (e) {
- Expect.isTrue(e is ArgumentError);
- }
-
- var existsFuture = file.exists();
- existsFuture.handleException((e) {
- Expect.isTrue(e is ArgumentError);
- return true;
- });
- existsFuture.then((bool) {
- Expect.fail('non-string name exists');
- });
- }
-
- static void testCreateInvalidArgs(name) {
- var file = new File(name);
- try {
- file.createSync();
- Expect.fail('exception expected');
- } catch (e) {
- Expect.isTrue(e is ArgumentError);
- }
-
- var createFuture = file.create();
- createFuture.handleException((e) {
- Expect.isTrue(e is ArgumentError);
- return true;
- });
- createFuture.then((ignore) => Expect.fail('non-string name exists'));
- }
-
static void testReadListInvalidArgs(buffer, offset, length) {
String filename = getFilename("tests/vm/data/fixed_length_file");
var file = (new File(filename)).openSync();
@@ -161,33 +106,11 @@ class FileTest {
file.close();
}
- static void testFullPathInvalidArgs(name) {
- var file = new File(name);
- try {
- file.fullPathSync();
- Expect.fail('exception expected');
- } catch (e) {
- Expect.isTrue(e is ArgumentError);
- }
-
- var fullPathFuture = file.fullPath();
- fullPathFuture.handleException((e) {
- Expect.isTrue(e is ArgumentError);
- return true;
- });
- fullPathFuture.then((path) {
- Expect.fail('full path invalid argument');
- });
- }
-
static String getFilename(String path) =>
new File(path).existsSync() ? path : 'runtime/$path';
}
main() {
- FileTest.testOpenInvalidArgs(0);
- FileTest.testExistsInvalidArgs(0);
- FileTest.testCreateInvalidArgs(0);
FileTest.testReadListInvalidArgs(12, 0, 1);
FileTest.testReadListInvalidArgs(new List(10), '0', 1);
FileTest.testReadListInvalidArgs(new List(10), 0, '1');
@@ -195,5 +118,4 @@ main() {
FileTest.testWriteListInvalidArgs(12, 0, 1);
FileTest.testWriteListInvalidArgs(new List(10), '0', 1);
FileTest.testWriteListInvalidArgs(new List(10), 0, '1');
- FileTest.testFullPathInvalidArgs(12);
}
« no previous file with comments | « no previous file | dart/tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698