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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/test/test_common.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of unittestTests; 5 library test_utils;
6
7 import 'package:unittest/unittest.dart';
8
9 import 'dart:async';
6 10
7 int errorCount; 11 int errorCount;
8 String errorString; 12 String errorString;
9 var _testHandler = null; 13 var _testHandler = null;
10 14
11 class MyFailureHandler extends DefaultFailureHandler { 15 class MyFailureHandler extends DefaultFailureHandler {
12 void fail(String reason) { 16 void fail(String reason) {
13 ++errorCount; 17 ++errorCount;
14 errorString = reason; 18 errorString = reason;
15 } 19 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 afterTest() { 55 afterTest() {
52 configureExpectFailureHandler(null); 56 configureExpectFailureHandler(null);
53 expect(errorCount, equals(0)); 57 expect(errorCount, equals(0));
54 } 58 }
55 if (isAsync) { 59 if (isAsync) {
56 Timer.run(expectAsync0(afterTest)); 60 Timer.run(expectAsync0(afterTest));
57 } else { 61 } else {
58 afterTest(); 62 afterTest();
59 } 63 }
60 } 64 }
65
66 doesNotThrow() {}
67 doesThrow() { throw 'X'; }
68
69 class PrefixMatcher extends BaseMatcher {
70 final String _prefix;
71 const PrefixMatcher(this._prefix);
72 bool matches(item, MatchState matchState) {
73 return item is String &&
74 (collapseWhitespace(item)).startsWith(collapseWhitespace(_prefix));
75 }
76
77 Description describe(Description description) =>
78 description.add('a string starting with ').
79 addDescriptionOf(collapseWhitespace(_prefix)).
80 add(' ignoring whitespace');
81 }
OLDNEW
« 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