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 import "package:expect/expect.dart"; | |
6 import "dart:io"; | 5 import "dart:io"; |
7 import "dart:isolate"; | 6 import "dart:isolate"; |
8 | 7 |
9 void testFailingList(Directory d, var recursive) { | 8 void testFailingList(Directory d, var recursive) { |
10 var port = new ReceivePort(); | 9 var port = new ReceivePort(); |
11 int errors = 0; | 10 int errors = 0; |
12 d.list(recursive: recursive).listen( | 11 d.list(recursive: recursive).listen( |
13 () => Expect.fail("Unexpected listing result"), | 12 () => Expect.fail("Unexpected listing result"), |
14 onError: (error) { | 13 onError: (error) { |
15 errors += 1; | 14 errors += 1; |
(...skipping 30 matching lines...) Expand all Loading... |
46 (e) => e is ArgumentError); | 45 (e) => e is ArgumentError); |
47 d = new Directory("."); | 46 d = new Directory("."); |
48 testFailingList(d, 1); | 47 testFailingList(d, 1); |
49 Expect.throws(() => d.listSync(recursive: 1), | 48 Expect.throws(() => d.listSync(recursive: 1), |
50 (e) => e is ArgumentError); | 49 (e) => e is ArgumentError); |
51 } | 50 } |
52 | 51 |
53 main() { | 52 main() { |
54 testInvalidArguments(); | 53 testInvalidArguments(); |
55 } | 54 } |
OLD | NEW |