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

Unified Diff: test/iterable_matchers_test.dart

Issue 840133003: matcher: fixed status file, formatting, tweaks to readme (Closed) Base URL: https://github.com/dart-lang/matcher.git@master
Patch Set: Created 5 years, 11 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: test/iterable_matchers_test.dart
diff --git a/test/iterable_matchers_test.dart b/test/iterable_matchers_test.dart
index 91d5335798f7aa2db9d6473be2923234775ba0b3..da454fbeccb8824e4037cb141079eb521b039281 100644
--- a/test/iterable_matchers_test.dart
+++ b/test/iterable_matchers_test.dart
@@ -47,8 +47,7 @@ void main() {
test('everyElement', () {
var d = [1, 2];
var e = [1, 1, 1];
- shouldFail(d, everyElement(1),
- "Expected: every element(<1>) "
+ shouldFail(d, everyElement(1), "Expected: every element(<1>) "
"Actual: [1, 2] "
"Which: has value <2> which doesn't match <1> at index 1");
shouldPass(e, everyElement(1));
@@ -64,21 +63,21 @@ void main() {
"Which: has value ['foo', 'bar'] which has value 'bar' "
"which is different. Expected: foo Actual: bar ^ "
"Differ at offset 0 at index 1 at index 0");
- shouldFail(d, everyElement(allOf(hasLength(greaterThan(0)),
- contains('foo'))),
- "Expected: every element((an object with length of a value "
- "greater than <0> and contains 'foo')) "
- "Actual: [['foo', 'bar'], ['foo'], []] "
- "Which: has value [] which has length of <0> at index 2");
- shouldFail(d, everyElement(allOf(contains('foo'),
- hasLength(greaterThan(0)))),
+ shouldFail(d,
+ everyElement(allOf(hasLength(greaterThan(0)), contains('foo'))),
+ "Expected: every element((an object with length of a value "
+ "greater than <0> and contains 'foo')) "
+ "Actual: [['foo', 'bar'], ['foo'], []] "
+ "Which: has value [] which has length of <0> at index 2");
+ shouldFail(d,
+ everyElement(allOf(contains('foo'), hasLength(greaterThan(0)))),
"Expected: every element((contains 'foo' and "
"an object with length of a value greater than <0>)) "
"Actual: [['foo', 'bar'], ['foo'], []] "
"Which: has value [] which doesn't match (contains 'foo' and "
"an object with length of a value greater than <0>) at index 2");
- shouldFail(e, everyElement(allOf(contains('foo'),
- hasLength(greaterThan(0)))),
+ shouldFail(e,
+ everyElement(allOf(contains('foo'), hasLength(greaterThan(0)))),
"Expected: every element((contains 'foo' and an object with "
"length of a value greater than <0>)) "
"Actual: [['foo', 'bar'], ['foo'], 3, []] "
@@ -90,16 +89,15 @@ void main() {
var d = [1, 2];
var e = [1, 1, 1];
shouldPass(d, anyElement(2));
- shouldFail(e, anyElement(2),
- "Expected: some element <2> Actual: [1, 1, 1]");
+ shouldFail(
+ e, anyElement(2), "Expected: some element <2> Actual: [1, 1, 1]");
});
test('orderedEquals', () {
shouldPass([null], orderedEquals([null]));
var d = [1, 2];
shouldPass(d, orderedEquals([1, 2]));
- shouldFail(d, orderedEquals([2, 1]),
- "Expected: equals [2, 1] ordered "
+ shouldFail(d, orderedEquals([2, 1]), "Expected: equals [2, 1] ordered "
"Actual: [1, 2] "
"Which: was <1> instead of <2> at location [0]");
});
@@ -107,16 +105,14 @@ void main() {
test('unorderedEquals', () {
var d = [1, 2];
shouldPass(d, unorderedEquals([2, 1]));
- shouldFail(d, unorderedEquals([1]),
- "Expected: equals [1] unordered "
+ shouldFail(d, unorderedEquals([1]), "Expected: equals [1] unordered "
"Actual: [1, 2] "
"Which: has too many elements (2 > 1)");
shouldFail(d, unorderedEquals([3, 2, 1]),
"Expected: equals [3, 2, 1] unordered "
"Actual: [1, 2] "
"Which: has too few elements (2 < 3)");
- shouldFail(d, unorderedEquals([3, 1]),
- "Expected: equals [3, 1] unordered "
+ shouldFail(d, unorderedEquals([3, 1]), "Expected: equals [3, 1] unordered "
"Actual: [1, 2] "
"Which: has no match for <3> at index 0");
});
@@ -139,7 +135,7 @@ void main() {
"Which: has no match for <3> at index 0");
shouldFail(d, unorderedMatches([greaterThan(3), greaterThan(0)]),
"Expected: matches [a value greater than <3>, a value greater than "
- "<0>] unordered "
+ "<0>] unordered "
"Actual: [1, 2] "
"Which: has no match for a value greater than <3> at index 0");
});
@@ -148,22 +144,21 @@ void main() {
var c = [1, 2];
var d = [1, 2, 3];
var e = [1, 4, 9];
- shouldFail('x', pairwiseCompare(e, (e,a) => a <= e,
- "less than or equal"),
+ shouldFail('x', pairwiseCompare(e, (e, a) => a <= e, "less than or equal"),
"Expected: pairwise less than or equal [1, 4, 9] "
"Actual: 'x' "
"Which: is not an Iterable");
- shouldFail(c, pairwiseCompare(e, (e,a) => a <= e, "less than or equal"),
+ shouldFail(c, pairwiseCompare(e, (e, a) => a <= e, "less than or equal"),
"Expected: pairwise less than or equal [1, 4, 9] "
"Actual: [1, 2] "
"Which: has length 2 instead of 3");
- shouldPass(d, pairwiseCompare(e, (e,a) => a <= e, "less than or equal"));
- shouldFail(d, pairwiseCompare(e, (e,a) => a < e, "less than"),
+ shouldPass(d, pairwiseCompare(e, (e, a) => a <= e, "less than or equal"));
+ shouldFail(d, pairwiseCompare(e, (e, a) => a < e, "less than"),
"Expected: pairwise less than [1, 4, 9] "
"Actual: [1, 2, 3] "
"Which: has <1> which is not less than <1> at index 0");
- shouldPass(d, pairwiseCompare(e, (e,a) => a * a == e, "square root of"));
- shouldFail(d, pairwiseCompare(e, (e,a) => a + a == e, "double"),
+ shouldPass(d, pairwiseCompare(e, (e, a) => a * a == e, "square root of"));
+ shouldFail(d, pairwiseCompare(e, (e, a) => a + a == e, "double"),
"Expected: pairwise double [1, 4, 9] "
"Actual: [1, 2, 3] "
"Which: has <1> which is not double <1> at index 0");

Powered by Google App Engine
This is Rietveld 408576698