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

Side by Side Diff: runtime/tests/dart/src/DirectoryTest.dart

Issue 8222006: Add simple directory listing test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // Directory listing test.
6
7 class DirectoryTest {
8 static void testListing() {
9 bool listedSomething = false;
10 Directory directory = new Directory.open(".");
11
12 directory.setDirHandler((dir) {
13 listedSomething = true;
14 });
15
16 directory.setFileHandler((f) {
17 listedSomething = true;
18 });
19
20 directory.setDoneHandler((completed) {
Søren Gjesse 2011/10/10 14:58:00 Perhaps format like directory.setDoneHandler(
Mads Ager (google) 2011/10/10 15:07:37 I like the current style better. I find the indent
21 Expect.isTrue(completed, "directory listing did not complete");
22 Expect.isTrue(listedSomething, "empty directory");
23 directory.close();
24 });
25
26 directory.setDirErrorHandler((dir) {
27 Expect.fail("error listing directory");
28 });
29
30 directory.list();
31 }
32
33 static void testMain() {
34 testListing();
35 }
36 }
37
38 main() {
39 DirectoryTest.testMain();
40 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698