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

Unified Diff: utils/tests/pub/version_solver_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: utils/tests/pub/version_solver_test.dart
===================================================================
--- utils/tests/pub/version_solver_test.dart (revision 14156)
+++ utils/tests/pub/version_solver_test.dart (working copy)
@@ -339,6 +339,20 @@
testResolve(description, packages, {lockfile, result, error}) {
test(description, () {
+ var isNoVersionException = predicate((x)=> x is NoVersionException,
+ "is a NoVersionException");
+ var isDisjointConstraintException =
+ predicate((x)=> x is DisjointConstraintException,
+ " is a DisjointConstraintException");
+ var isSourceMismatchException =
+ predicate((x)=> x is SourceMismatchException,
+ "is a SourceMismatchException");
+ var isDescriptionMismatchException =
+ predicate((x)=> x is DescriptionMismatchException,
+ "is a DescriptionMismatchException");
+ var isCouldNotSolveException = predicate((x)=> x is CouldNotSolveException,
+ "is a CouldNotSolveException");
+
var sources = new SourceRegistry();
source1 = new MockSource('mock1');
source2 = new MockSource('mock2');
@@ -405,17 +419,17 @@
if (actualId != expectedId) return false;
}
return result.isEmpty;
- }, description: 'packages to match $result')));
+ }, 'packages to match $result')));
} else if (error == noVersion) {
- expect(future, throwsA(new isInstanceOf<NoVersionException>()));
+ expect(future, throwsA(isNoVersionException));
} else if (error == disjointConstraint) {
- expect(future, throwsA(new isInstanceOf<DisjointConstraintException>()));
+ expect(future, throwsA(isDisjointConstraintException));
} else if (error == sourceMismatch) {
- expect(future, throwsA(new isInstanceOf<SourceMismatchException>()));
+ expect(future, throwsA(isSourceMismatchException));
} else if (error == descriptionMismatch) {
- expect(future, throwsA(new isInstanceOf<DescriptionMismatchException>()));
+ expect(future, throwsA(isDescriptionMismatchException));
} else if (error == couldNotSolve) {
- expect(future, throwsA(new isInstanceOf<CouldNotSolveException>()));
+ expect(future, throwsA(isCouldNotSolveException));
} else {
expect(future, throwsA(error));
}

Powered by Google App Engine
This is Rietveld 408576698