| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 | 10 |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 Expect.isTrue(e is FileIOException); | 974 Expect.isTrue(e is FileIOException); |
| 975 } | 975 } |
| 976 } | 976 } |
| 977 | 977 |
| 978 static void testOpenFileFromPath() { | 978 static void testOpenFileFromPath() { |
| 979 var name = getFilename("tests/vm/data/fixed_length_file"); | 979 var name = getFilename("tests/vm/data/fixed_length_file"); |
| 980 var path = new Path(name); | 980 var path = new Path(name); |
| 981 var f = new File.fromPath(path); | 981 var f = new File.fromPath(path); |
| 982 Expect.isTrue(f.existsSync()); | 982 Expect.isTrue(f.existsSync()); |
| 983 name = f.fullPathSync(); | 983 name = f.fullPathSync(); |
| 984 path = new Path.fromNative(name); | 984 path = new Path(name); |
| 985 var g = new File.fromPath(path); | 985 var g = new File.fromPath(path); |
| 986 Expect.isTrue(g.existsSync()); | 986 Expect.isTrue(g.existsSync()); |
| 987 Expect.equals(name, g.fullPathSync()); | 987 Expect.equals(name, g.fullPathSync()); |
| 988 } | 988 } |
| 989 | 989 |
| 990 static void testReadAsBytes() { | 990 static void testReadAsBytes() { |
| 991 var port = new ReceivePort(); | 991 var port = new ReceivePort(); |
| 992 port.receive((result, replyTo) { | 992 port.receive((result, replyTo) { |
| 993 port.close(); | 993 port.close(); |
| 994 Expect.equals(42, result); | 994 Expect.equals(42, result); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 testDirectorySync(); | 1321 testDirectorySync(); |
| 1322 testWriteStringUtf8(); | 1322 testWriteStringUtf8(); |
| 1323 testWriteStringUtf8Sync(); | 1323 testWriteStringUtf8Sync(); |
| 1324 }); | 1324 }); |
| 1325 } | 1325 } |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 main() { | 1328 main() { |
| 1329 FileTest.testMain(); | 1329 FileTest.testMain(); |
| 1330 } | 1330 } |
| OLD | NEW |