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

Side by Side Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 19789015: TBR: Change BaseMatcher to Matcher in pub test file. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « no previous file | 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) 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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub
6 /// tests are integration tests that stage some stuff on the file system, run 6 /// tests are integration tests that stage some stuff on the file system, run
7 /// pub, and then validate the results. This library provides an API to build 7 /// pub, and then validate the results. This library provides an API to build
8 /// tests like that. 8 /// tests like that.
9 library test_pub; 9 library test_pub;
10 10
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 return new Pair(validator.errors, validator.warnings); 742 return new Pair(validator.errors, validator.warnings);
743 }); 743 });
744 }); 744 });
745 }, "validating package"); 745 }, "validating package");
746 } 746 }
747 747
748 /// A matcher that matches a Pair. 748 /// A matcher that matches a Pair.
749 Matcher pairOf(Matcher firstMatcher, Matcher lastMatcher) => 749 Matcher pairOf(Matcher firstMatcher, Matcher lastMatcher) =>
750 new _PairMatcher(firstMatcher, lastMatcher); 750 new _PairMatcher(firstMatcher, lastMatcher);
751 751
752 class _PairMatcher extends BaseMatcher { 752 class _PairMatcher extends Matcher {
753 final Matcher _firstMatcher; 753 final Matcher _firstMatcher;
754 final Matcher _lastMatcher; 754 final Matcher _lastMatcher;
755 755
756 _PairMatcher(this._firstMatcher, this._lastMatcher); 756 _PairMatcher(this._firstMatcher, this._lastMatcher);
757 757
758 bool matches(item, Map matchState) { 758 bool matches(item, Map matchState) {
759 if (item is! Pair) return false; 759 if (item is! Pair) return false;
760 return _firstMatcher.matches(item.first, matchState) && 760 return _firstMatcher.matches(item.first, matchState) &&
761 _lastMatcher.matches(item.last, matchState); 761 _lastMatcher.matches(item.last, matchState);
762 } 762 }
763 763
764 Description describe(Description description) { 764 Description describe(Description description) {
765 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 765 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
766 } 766 }
767 } 767 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698