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

Side by Side Diff: pkg/scheduled_test/lib/descriptor.dart

Issue 12321122: Add a nothing descriptor to scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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) 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 [Entry.create] to schedule a task that will create that structure on 9 /// call [Entry.create] to schedule a task that will create that structure on
10 /// the physical filesystem, or [Entry.validate] to schedule an assertion that 10 /// the physical filesystem, or [Entry.validate] to schedule an assertion that
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 import 'dart:async'; 65 import 'dart:async';
66 66
67 import 'package:pathos/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.dart'; 70 import 'src/descriptor/async.dart';
71 import 'src/descriptor/directory.dart'; 71 import 'src/descriptor/directory.dart';
72 import 'src/descriptor/entry.dart'; 72 import 'src/descriptor/entry.dart';
73 import 'src/descriptor/file.dart'; 73 import 'src/descriptor/file.dart';
74 import 'src/descriptor/nothing.dart';
74 75
75 export 'src/descriptor/async.dart'; 76 export 'src/descriptor/async.dart';
76 export 'src/descriptor/directory.dart'; 77 export 'src/descriptor/directory.dart';
77 export 'src/descriptor/entry.dart'; 78 export 'src/descriptor/entry.dart';
78 export 'src/descriptor/file.dart'; 79 export 'src/descriptor/file.dart';
80 export 'src/descriptor/nothing.dart';
79 81
80 /// The root path for descriptors. Top-level descriptors will be created and 82 /// The root path for descriptors. Top-level descriptors will be created and
81 /// validated at this path. Defaults to the current working directory. 83 /// validated at this path. Defaults to the current working directory.
82 /// 84 ///
83 /// If this is set to `null`, it will reset itself to the current working 85 /// If this is set to `null`, it will reset itself to the current working
84 /// directory. 86 /// directory.
85 String get defaultRoot => _defaultRoot == null ? path.current : _defaultRoot; 87 String get defaultRoot => _defaultRoot == null ? path.current : _defaultRoot;
86 set defaultRoot(String value) { 88 set defaultRoot(String value) {
87 _defaultRoot = value; 89 _defaultRoot = value;
88 } 90 }
89 String _defaultRoot; 91 String _defaultRoot;
90 92
91 /// Creates a new text [File] descriptor with [name] and [contents]. 93 /// Creates a new text [File] descriptor with [name] and [contents].
92 File file(Pattern name, [String contents='']) => new File(name, contents); 94 File file(Pattern name, [String contents='']) => new File(name, contents);
93 95
94 /// Creates a new binary [File] descriptor with [name] and [contents]. 96 /// Creates a new binary [File] descriptor with [name] and [contents].
95 File binaryFile(Pattern name, List<int> contents) => 97 File binaryFile(Pattern name, List<int> contents) =>
96 new File.binary(name, contents); 98 new File.binary(name, contents);
97 99
98 /// Creates a new [Directory] descriptor with [name] and [contents]. 100 /// Creates a new [Directory] descriptor with [name] and [contents].
99 Directory dir(Pattern name, [Iterable<Entry> contents]) => 101 Directory dir(Pattern name, [Iterable<Entry> contents]) =>
100 new Directory(name, contents == null ? <Entry>[] : contents); 102 new Directory(name, contents == null ? <Entry>[] : contents);
101 103
102 /// Creates a new descriptor wrapping a [Future]. This descriptor forwards all 104 /// Creates a new descriptor wrapping a [Future]. This descriptor forwards all
103 /// asynchronous operations to the result of [future]. 105 /// asynchronous operations to the result of [future].
104 Async async(Future<Entry> future) => new Async(future); 106 Async async(Future<Entry> future) => new Async(future);
107
108 /// Creates a new [Nothing] descriptor that asserts that no entry named [name]
109 /// exists.
110 Nothing nothing(Pattern name) => new Nothing(name);
OLDNEW
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/nothing.dart » ('j') | pkg/scheduled_test/lib/src/descriptor/nothing.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698