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

Side by Side Diff: tests/standalone/io/file_invalid_arguments_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: Remove stray blank line 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/file_input_stream_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:async"; 5 import "dart:async";
6 import "dart:io"; 6 import "dart:io";
7 7
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 FileSystemEntity.identical(x, y))([1,2,3], "."))) 92 FileSystemEntity.identical(x, y))([1,2,3], ".")))
93 .then((_) => futureThrows(((x, y) => 93 .then((_) => futureThrows(((x, y) =>
94 FileSystemEntity.identical(x, y))(".", 52))) 94 FileSystemEntity.identical(x, y))(".", 52)))
95 .then((_) => futureThrows(((x) => FileSystemEntity.isLink(x))(52))) 95 .then((_) => futureThrows(((x) => FileSystemEntity.isLink(x))(52)))
96 .then((_) => futureThrows(((x) => FileSystemEntity.isFile(x))(52))) 96 .then((_) => futureThrows(((x) => FileSystemEntity.isFile(x))(52)))
97 .then((_) => futureThrows(((x) => FileSystemEntity.isDirectory(x))(52))) 97 .then((_) => futureThrows(((x) => FileSystemEntity.isDirectory(x))(52)))
98 .then((_) => asyncEnd()); 98 .then((_) => asyncEnd());
99 } 99 }
100 100
101 String getFilename(String path) { 101 String getFilename(String path) {
102 return new File(path).existsSync() ? path : 'runtime/$path'; 102 var testPath = Platform.script.resolve('../../../$path');
103 return new File.fromUri(testPath).existsSync()
104 ? testPath.toFilePath()
105 : Platform.script.resolve('../../../runtime/$path').toFilePath();
103 } 106 }
104 107
105 main() { 108 main() {
106 testReadInvalidArgs('asdf'); 109 testReadInvalidArgs('asdf');
107 testReadIntoInvalidArgs(12, 0, 1); 110 testReadIntoInvalidArgs(12, 0, 1);
108 testReadIntoInvalidArgs(new List(10), '0', 1); 111 testReadIntoInvalidArgs(new List(10), '0', 1);
109 testReadIntoInvalidArgs(new List(10), 0, '1'); 112 testReadIntoInvalidArgs(new List(10), 0, '1');
110 testWriteByteInvalidArgs('asdf'); 113 testWriteByteInvalidArgs('asdf');
111 testWriteFromInvalidArgs(12, 0, 1); 114 testWriteFromInvalidArgs(12, 0, 1);
112 testWriteFromInvalidArgs(new List(10), '0', 1); 115 testWriteFromInvalidArgs(new List(10), '0', 1);
113 testWriteFromInvalidArgs(new List(10), 0, '1'); 116 testWriteFromInvalidArgs(new List(10), 0, '1');
114 testWriteStringInvalidArgs("Hello, world", 42); 117 testWriteStringInvalidArgs("Hello, world", 42);
115 testFileSystemEntity(); 118 testFileSystemEntity();
116 } 119 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_input_stream_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698