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

Issue 112583003: Add an [unorderedMatches] matcher to unittest. (Closed)

Created:
7 years ago by nweiz
Modified:
7 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add an [unorderedMatches] matcher to unittest. This is like [unorderedEquals], but it instead takes an iterable of matchers and asserts that elements in the actual value match the matchers. R=sigmund@google.com Committed: https://code.google.com/p/dart/source/detail?r=31178

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -1 line) Patch
M pkg/unittest/lib/src/iterable_matchers.dart View 2 chunks +68 lines, -0 lines 4 comments Download
M pkg/unittest/pubspec.yaml View 1 chunk +1 line, -1 line 2 comments Download
M pkg/unittest/test/matchers_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
nweiz
7 years ago (2013-12-17 00:17:11 UTC) #1
Siggi Cherem (dart-lang)
lgtm, with comments below https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterable_matchers.dart File pkg/unittest/lib/src/iterable_matchers.dart (right): https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterable_matchers.dart#newcode138 pkg/unittest/lib/src/iterable_matchers.dart:138: List<bool> matched = new List<bool>(actualLength); ...
7 years ago (2013-12-17 00:32:03 UTC) #2
nweiz
https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterable_matchers.dart File pkg/unittest/lib/src/iterable_matchers.dart (right): https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterable_matchers.dart#newcode205 pkg/unittest/lib/src/iterable_matchers.dart:205: class _UnorderedMatches extends Matcher { On 2013/12/17 00:32:03, Siggi ...
7 years ago (2013-12-17 03:33:47 UTC) #3
nweiz
Committed patchset #1 manually as r31178 (presubmit successful).
7 years ago (2013-12-17 03:34:06 UTC) #4
Siggi Cherem (dart-lang)
7 years ago (2013-12-17 18:48:44 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterabl...
File pkg/unittest/lib/src/iterable_matchers.dart (right):

https://codereview.chromium.org/112583003/diff/1/pkg/unittest/lib/src/iterabl...
pkg/unittest/lib/src/iterable_matchers.dart:205: class _UnorderedMatches extends
Matcher {
On 2013/12/17 03:33:47, nweiz wrote:
> On 2013/12/17 00:32:03, Siggi Cherem (dart-lang) wrote:
> > seems like there is a lot of code in common here and with _UnorderedEquals.
Is
> > there any way we could combine some of this code? For example, pass in a
> > equality sub-matcher here as a default?
> 
> I intentionally avoided going too deep on modifying existing unittest stuff,
> since it's nearing the end of its life and it seemed like it wouldn't be
effort
> well-spent. If you'd like me to, I can, but I don't think it will provide much
> value.

I think it is worth the effort for the matchers library.

I agree that unittest needs to be rewritten and we shouldn't try to change it
much, but I had that in mind only for the core of unittest (the running logic
and declarations). I think 'matchers' and 'mock' are fine as they are, or can be
upgraded incrementally, so we should keep maintaining them. I actually thought
we will pull them into separate packages and let unittest (and any future
testing package) re-export them.

Powered by Google App Engine
This is Rietveld 408576698