| 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 // Dart test program for testing file I/O. | 5 // Dart test program for testing file I/O. |
| 6 | 6 |
| 7 // OtherResources=fixed_length_file | 7 // OtherResources=fixed_length_file |
| 8 // OtherResources=read_as_text.dat | 8 // OtherResources=read_as_text.dat |
| 9 // OtherResources=readline_test1.dat | 9 // OtherResources=readline_test1.dat |
| 10 | 10 |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 brokenLink.createSync(dest); | 1399 brokenLink.createSync(dest); |
| 1400 Expect.throws(() => file.renameSync('xxx')); | 1400 Expect.throws(() => file.renameSync('xxx')); |
| 1401 brokenLink.deleteSync(); | 1401 brokenLink.deleteSync(); |
| 1402 } | 1402 } |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 // Helper method to be able to run the test from the runtime | 1405 // Helper method to be able to run the test from the runtime |
| 1406 // directory, or the top directory. | 1406 // directory, or the top directory. |
| 1407 static String getFilename(String path) { | 1407 static String getFilename(String path) { |
| 1408 var testPath = Platform.script.resolve(path); | 1408 var testPath = Platform.script.resolve(path); |
| 1409 return new File.fromUri(testPath).existsSync() | 1409 if (new File.fromUri(testPath).existsSync()) { |
| 1410 ? testPath.toFilePath() | 1410 return testPath.toFilePath(); |
| 1411 : Uri.parse(Platform.executable).resolve('../../runtime/$path').toFilePa
th(); | 1411 } |
| 1412 return Uri.parse(Platform.resolvedExecutable) |
| 1413 .resolve('../../runtime/$path').toFilePath(); |
| 1412 } | 1414 } |
| 1413 | 1415 |
| 1414 // Main test entrypoint. | 1416 // Main test entrypoint. |
| 1415 static testMain() { | 1417 static testMain() { |
| 1416 asyncStart(); | 1418 asyncStart(); |
| 1417 | 1419 |
| 1418 testRead(); | 1420 testRead(); |
| 1419 testReadSync(); | 1421 testReadSync(); |
| 1420 testReadStream(); | 1422 testReadStream(); |
| 1421 testLengthSync(); | 1423 testLengthSync(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 testLastModified(); | 1473 testLastModified(); |
| 1472 testDoubleAsyncOperation(); | 1474 testDoubleAsyncOperation(); |
| 1473 asyncEnd(); | 1475 asyncEnd(); |
| 1474 }); | 1476 }); |
| 1475 } | 1477 } |
| 1476 } | 1478 } |
| 1477 | 1479 |
| 1478 main() { | 1480 main() { |
| 1479 FileTest.testMain(); | 1481 FileTest.testMain(); |
| 1480 } | 1482 } |
| OLD | NEW |