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

Side by Side Diff: pkg/unittest/lib/unittest.dart

Issue 12537009: Rename XMatching to XWhere. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge and rebuild dom libraries. Created 7 years, 9 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/serialization/test/serialization_test.dart ('k') | runtime/lib/array.dart » ('j') | 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) 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 /** 5 /**
6 * A library for writing dart unit tests. 6 * A library for writing dart unit tests.
7 * 7 *
8 * To import this library, install the 8 * To import this library, install the
9 * [unittest package](http://pub.dartlang.org/packages/unittest) via the pub 9 * [unittest package](http://pub.dartlang.org/packages/unittest) via the pub
10 * package manager. See the [Getting Started](http://pub.dartlang.org/doc) 10 * package manager. See the [Getting Started](http://pub.dartlang.org/doc)
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 void filterTests(testFilter) { 682 void filterTests(testFilter) {
683 var filterFunction; 683 var filterFunction;
684 if (testFilter is String) { 684 if (testFilter is String) {
685 RegExp re = new RegExp(testFilter); 685 RegExp re = new RegExp(testFilter);
686 filterFunction = (t) => re.hasMatch(t.description); 686 filterFunction = (t) => re.hasMatch(t.description);
687 } else if (testFilter is RegExp) { 687 } else if (testFilter is RegExp) {
688 filterFunction = (t) => testFilter.hasMatch(t.description); 688 filterFunction = (t) => testFilter.hasMatch(t.description);
689 } else if (testFilter is Function) { 689 } else if (testFilter is Function) {
690 filterFunction = testFilter; 690 filterFunction = testFilter;
691 } 691 }
692 _tests.retainMatching(filterFunction); 692 _tests.retainWhere(filterFunction);
693 } 693 }
694 694
695 /** Runs all queued tests, one at a time. */ 695 /** Runs all queued tests, one at a time. */
696 void runTests() { 696 void runTests() {
697 _currentTest = 0; 697 _currentTest = 0;
698 _currentGroup = ''; 698 _currentGroup = '';
699 699
700 // If we are soloing a test, remove all the others. 700 // If we are soloing a test, remove all the others.
701 if (_soloTest != null) { 701 if (_soloTest != null) {
702 filterTests((t) => t == _soloTest); 702 filterTests((t) => t == _soloTest);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 /** Enable a test by ID. */ 853 /** Enable a test by ID. */
854 void enableTest(int testId) => _setTestEnabledState(testId, true); 854 void enableTest(int testId) => _setTestEnabledState(testId, true);
855 855
856 /** Disable a test by ID. */ 856 /** Disable a test by ID. */
857 void disableTest(int testId) => _setTestEnabledState(testId, false); 857 void disableTest(int testId) => _setTestEnabledState(testId, false);
858 858
859 /** Signature for a test function. */ 859 /** Signature for a test function. */
860 typedef dynamic TestFunction(); 860 typedef dynamic TestFunction();
OLDNEW
« no previous file with comments | « pkg/serialization/test/serialization_test.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698