Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: tests/standalone/io/directory_invalid_arguments_test.dart

Issue 11748017: Add synchronous directory listing to dart:io Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments, move tests that fail on Windows due to VM bug 7157 to a separate test file. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "dart:io"; 5 import "dart:io";
6 6
7 class DirectoryInvalidArgumentsTest { 7 class DirectoryInvalidArgumentsTest {
8 static void testFailingList(Directory d, var recursive) { 8 static void testFailingList(Directory d, var recursive) {
9 int errors = 0; 9 int errors = 0;
10 var lister = d.list(recursive: recursive); 10 var lister = d.list(recursive: recursive);
(...skipping 21 matching lines...) Expand all
32 } catch (e) { 32 } catch (e) {
33 Expect.isTrue(e is ArgumentError); 33 Expect.isTrue(e is ArgumentError);
34 } 34 }
35 try { 35 try {
36 d.createSync(); 36 d.createSync();
37 Expect.fail("No exception thrown"); 37 Expect.fail("No exception thrown");
38 } catch (e) { 38 } catch (e) {
39 Expect.isTrue(e is ArgumentError); 39 Expect.isTrue(e is ArgumentError);
40 } 40 }
41 testFailingList(d, false); 41 testFailingList(d, false);
42 Expect.throws(() => d.listSync(recursive: true),
43 (e) => e is ArgumentError);
42 d = new Directory("."); 44 d = new Directory(".");
43 testFailingList(d, 1); 45 testFailingList(d, 1);
46 Expect.throws(() => d.listSync(recursive: 1),
47 (e) => e is ArgumentError);
44 } 48 }
45 49
46 static void testMain() { 50 static void testMain() {
47 testInvalidArguments(); 51 testInvalidArguments();
48 } 52 }
49 } 53 }
50 54
51 main() { 55 main() {
52 DirectoryInvalidArgumentsTest.testMain(); 56 DirectoryInvalidArgumentsTest.testMain();
53 } 57 }
OLDNEW
« no previous file with comments | « tests/standalone/io/directory_fuzz_test.dart ('k') | tests/standalone/io/directory_list_nonexistent_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698