| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |