OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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:io"); |
| 6 |
5 class FileTest { | 7 class FileTest { |
6 static void testOpenInvalidArgs(name, [writable = false]) { | 8 static void testOpenInvalidArgs(name, [writable = false]) { |
7 var file = new File(name); | 9 var file = new File(name); |
8 try { | 10 try { |
9 file.openSync(); | 11 file.openSync(); |
10 Expect.fail('exception expected'); | 12 Expect.fail('exception expected'); |
11 } catch (var e) { | 13 } catch (var e) { |
12 Expect.isTrue(e is FileIOException); | 14 Expect.isTrue(e is FileIOException); |
13 Expect.isTrue(e.toString().contains('open file')); | 15 Expect.isTrue(e.toString().contains('open file')); |
14 } | 16 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 FileTest.testCreateInvalidArgs(0); | 197 FileTest.testCreateInvalidArgs(0); |
196 FileTest.testReadListInvalidArgs(12, 0, 1); | 198 FileTest.testReadListInvalidArgs(12, 0, 1); |
197 FileTest.testReadListInvalidArgs(new List(10), '0', 1); | 199 FileTest.testReadListInvalidArgs(new List(10), '0', 1); |
198 FileTest.testReadListInvalidArgs(new List(10), 0, '1'); | 200 FileTest.testReadListInvalidArgs(new List(10), 0, '1'); |
199 FileTest.testWriteByteInvalidArgs('asdf'); | 201 FileTest.testWriteByteInvalidArgs('asdf'); |
200 FileTest.testWriteListInvalidArgs(12, 0, 1); | 202 FileTest.testWriteListInvalidArgs(12, 0, 1); |
201 FileTest.testWriteListInvalidArgs(new List(10), '0', 1); | 203 FileTest.testWriteListInvalidArgs(new List(10), '0', 1); |
202 FileTest.testWriteListInvalidArgs(new List(10), 0, '1'); | 204 FileTest.testWriteListInvalidArgs(new List(10), 0, '1'); |
203 FileTest.testFullPathInvalidArgs(12); | 205 FileTest.testFullPathInvalidArgs(12); |
204 } | 206 } |
OLD | NEW |