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

Side by Side Diff: tests/standalone/src/DirectoryInvalidArgumentsTest.dart

Issue 8417023: Add type checks to directory listing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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
(Empty)
1 class DirectoryInvalidArgumentsTest {
2 static void testFailingList(Directory d, var recursive) {
3 int errors = 0;
4 d.setErrorHandler((error) {
5 errors += 1;
6 });
7 d.setDoneHandler((completed) {
8 Expect.equals(1, errors);
9 Expect.isFalse(completed);
10 });
11 Expect.equals(0, errors);
12 d.list(recursive);
13 }
14
15 static void testInvalidArguments() {
16 Directory d = new Directory(12);
17 Expect.isFalse(d.exists());
18 try {
19 d.delete();
20 Expect.fail("No exception thrown");
21 } catch (var e) {
22 Expect.isTrue(e is DirectoryException);
23 }
24 try {
25 d.create();
26 Expect.fail("No exception thrown");
27 } catch (var e) {
28 Expect.isTrue(e is DirectoryException);
29 }
30 testFailingList(d, false);
31 d = new Directory(".");
32 testFailingList(d, 1);
33 }
34
35 static void testMain() {
36 testInvalidArguments();
37 }
38 }
39
40 main() {
41 DirectoryInvalidArgumentsTest.testMain();
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698