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

Unified Diff: pkg/scheduled_test/lib/descriptor.dart

Issue 15074003: Add the ability to match the contents of a file descriptor against a Matcher. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/descriptor.dart
diff --git a/pkg/scheduled_test/lib/descriptor.dart b/pkg/scheduled_test/lib/descriptor.dart
index 1b2b9880d8a242790617cf383061db355057eec7..18192470bd5490c8df1e4cad82d72e4d3705c01a 100644
--- a/pkg/scheduled_test/lib/descriptor.dart
+++ b/pkg/scheduled_test/lib/descriptor.dart
@@ -100,6 +100,18 @@ FileDescriptor file(String name, [String contents='']) =>
FileDescriptor binaryFile(String name, List<int> contents) =>
new FileDescriptor.binary(name, contents);
+/// Creates a new text [FileDescriptor] with [name] that matches its String
+/// contents against [matcher]. If the file is created, it's considered to be
+/// empty.
+FileDescriptor matcherFile(String name, matcher) =>
+ new FileDescriptor.matcher(name, wrapMatcher(matcher));
+
+/// Creates a new binary [FileDescriptor] with [name] that matches its binary
+/// contents against [matcher]. If the file is created, it's considered to be
+/// empty.
+FileDescriptor binaryMatcherFile(String name, matcher) =>
+ new FileDescriptor.binaryMatcher(name, wrapMatcher(matcher));
+
/// Creates a new [DirectoryDescriptor] descriptor with [name] and [contents].
DirectoryDescriptor dir(String name, [Iterable<Descriptor> contents]) =>
new DirectoryDescriptor(name, contents == null? <Descriptor>[] : contents);
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698