| 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');
|
| +}
|
|
|