OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// A library for declaratively describing a filesystem structure, usually for | 5 /// A library for declaratively describing a filesystem structure, usually for |
6 /// the purpose of creating or validating it as part of a scheduled test. | 6 /// the purpose of creating or validating it as part of a scheduled test. |
7 /// | 7 /// |
8 /// You can use [dir] and [file] to define a filesystem structure. Then, you can | 8 /// You can use [dir] and [file] to define a filesystem structure. Then, you can |
9 /// call [Descriptor.create] to schedule a task that will create that structure | 9 /// call [Descriptor.create] to schedule a task that will create that structure |
10 /// on the physical filesystem, or [Descriptor.validate] to schedule an | 10 /// on the physical filesystem, or [Descriptor.validate] to schedule an |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 /// return tempDir.delete(recursive: true); | 57 /// return tempDir.delete(recursive: true); |
58 /// }); | 58 /// }); |
59 /// }); | 59 /// }); |
60 /// | 60 /// |
61 /// // ... | 61 /// // ... |
62 /// } | 62 /// } |
63 library descriptor; | 63 library descriptor; |
64 | 64 |
65 import 'dart:async'; | 65 import 'dart:async'; |
66 | 66 |
67 import '../../../pkg/pathos/lib/path.dart' as path; | 67 import 'package:pathos/path.dart' as path; |
68 | 68 |
69 import 'scheduled_test.dart'; | 69 import 'scheduled_test.dart'; |
70 import 'src/descriptor/async_descriptor.dart'; | 70 import 'src/descriptor/async_descriptor.dart'; |
71 import 'src/descriptor/descriptor.dart'; | 71 import 'src/descriptor/descriptor.dart'; |
72 import 'src/descriptor/directory_descriptor.dart'; | 72 import 'src/descriptor/directory_descriptor.dart'; |
73 import 'src/descriptor/file_descriptor.dart'; | 73 import 'src/descriptor/file_descriptor.dart'; |
74 import 'src/descriptor/nothing_descriptor.dart'; | 74 import 'src/descriptor/nothing_descriptor.dart'; |
75 import 'src/descriptor/pattern_descriptor.dart'; | 75 import 'src/descriptor/pattern_descriptor.dart'; |
76 | 76 |
77 export 'src/descriptor/async_descriptor.dart'; | 77 export 'src/descriptor/async_descriptor.dart'; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 /// A convenience method for creating a [PatternDescriptor] descriptor that | 122 /// A convenience method for creating a [PatternDescriptor] descriptor that |
123 /// constructs a [FileDescriptor] descriptor. | 123 /// constructs a [FileDescriptor] descriptor. |
124 PatternDescriptor filePattern(Pattern name, [String contents='']) => | 124 PatternDescriptor filePattern(Pattern name, [String contents='']) => |
125 pattern(name, (realName) => file(realName, contents)); | 125 pattern(name, (realName) => file(realName, contents)); |
126 | 126 |
127 /// A convenience method for creating a [PatternDescriptor] descriptor that | 127 /// A convenience method for creating a [PatternDescriptor] descriptor that |
128 /// constructs a [DirectoryDescriptor] descriptor. | 128 /// constructs a [DirectoryDescriptor] descriptor. |
129 PatternDescriptor dirPattern(Pattern name, [Iterable<Descriptor> contents]) => | 129 PatternDescriptor dirPattern(Pattern name, [Iterable<Descriptor> contents]) => |
130 pattern(name, (realName) => dir(realName, contents)); | 130 pattern(name, (realName) => dir(realName, contents)); |
OLD | NEW |