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

Unified Diff: pkg/unittest/test/test_utils.dart

Issue 15492003: Split out unittest tests whose behavior differs in minified mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. 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 | « pkg/unittest/test/test_common.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/test_utils.dart
diff --git a/pkg/unittest/test/test_utils.dart b/pkg/unittest/test/test_utils.dart
index d783665df19e784eb2f760bb88a243d1bdff859b..f0b276d060b8ba6299f9803d60a01ec6911cf650 100644
--- a/pkg/unittest/test/test_utils.dart
+++ b/pkg/unittest/test/test_utils.dart
@@ -2,7 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of unittestTests;
+library test_utils;
+
+import 'package:unittest/unittest.dart';
+
+import 'dart:async';
int errorCount;
String errorString;
@@ -58,3 +62,20 @@ void shouldPass(value, Matcher matcher, {bool isAsync: false}) {
afterTest();
}
}
+
+doesNotThrow() {}
+doesThrow() { throw 'X'; }
+
+class PrefixMatcher extends BaseMatcher {
+ final String _prefix;
+ const PrefixMatcher(this._prefix);
+ bool matches(item, MatchState matchState) {
+ return item is String &&
+ (collapseWhitespace(item)).startsWith(collapseWhitespace(_prefix));
+ }
+
+ Description describe(Description description) =>
+ description.add('a string starting with ').
+ addDescriptionOf(collapseWhitespace(_prefix)).
+ add(' ignoring whitespace');
+}
« no previous file with comments | « pkg/unittest/test/test_common.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698