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

Issue 12217142: Unit test improvements: (Closed)

Created:
7 years, 10 months ago by gram
Modified:
7 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Unit test improvements: When doing equality tests, if two items have a different type but the same toString() represenation it can be hard to figure out the difference; we now include type info. See https://code.google.com/p/dart/issues/detail?id=6816 If callbacks are not anonymous we include their names in error messages. Throws matchers will fail now on arguments that are not Functions or Futures. See https://code.google.com/p/dart/issues/detail?id=6761 Fix initial comment on how to use unittest; see issue https://code.google.com/p/dart/issues/detail?id=7835 The verbose flag to expect worked to show contents of Iterables but not Maps; fixed that. Committed: https://code.google.com/p/dart/source/detail?r=18401

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Patch Set 3 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -16 lines) Patch
M pkg/unittest/lib/src/core_matchers.dart View 3 chunks +20 lines, -8 lines 1 comment Download
M pkg/unittest/lib/src/expect.dart View 1 2 1 chunk +18 lines, -2 lines 4 comments Download
M pkg/unittest/lib/unittest.dart View 1 2 chunks +13 lines, -2 lines 0 comments Download
M pkg/unittest/test/matchers_test.dart View 2 chunks +11 lines, -0 lines 0 comments Download
M pkg/unittest/test/unittest_test.dart View 4 chunks +9 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
gram
7 years, 10 months ago (2013-02-12 18:51:02 UTC) #1
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/12217142/diff/1/pkg/unittest/lib/src/core_matchers.dart File pkg/unittest/lib/src/core_matchers.dart (right): https://codereview.chromium.org/12217142/diff/1/pkg/unittest/lib/src/core_matchers.dart#newcode332 pkg/unittest/lib/src/core_matchers.dart:332: return false; nit: given that this is fast-exit ...
7 years, 10 months ago (2013-02-12 20:48:51 UTC) #2
gram
PTAL at expect.dart; I added a change there that I don't think made it in ...
7 years, 10 months ago (2013-02-12 20:59:30 UTC) #3
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/expect.dart File pkg/unittest/lib/src/expect.dart (right): https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/expect.dart#newcode130 pkg/unittest/lib/src/expect.dart:130: var count = 25; seems quite arbitrary to ...
7 years, 10 months ago (2013-02-12 21:06:15 UTC) #4
Siggi Cherem (dart-lang)
https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/core_matchers.dart File pkg/unittest/lib/src/core_matchers.dart (right): https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/core_matchers.dart#newcode331 pkg/unittest/lib/src/core_matchers.dart:331: } else if (item is! Function) { btw seems ...
7 years, 10 months ago (2013-02-12 21:07:09 UTC) #5
gram
7 years, 10 months ago (2013-02-12 21:08:09 UTC) #6
https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/expec...
File pkg/unittest/lib/src/expect.dart (right):

https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/expec...
pkg/unittest/lib/src/expect.dart:130: var count = 25;
On 2013/02/12 21:06:15, Siggi Cherem (dart-lang) wrote:
> seems quite arbitrary to use 25 =)... maybe 10? (especially since there is 1
per
> line?)

As you say, it is arbitrary. 10 feels too small for me though.

https://codereview.chromium.org/12217142/diff/6001/pkg/unittest/lib/src/expec...
pkg/unittest/lib/src/expect.dart:131: for (var k in actual.keys) {
On 2013/02/12 21:06:15, Siggi Cherem (dart-lang) wrote:
> Is this description used for any other purpose? Will it matter that keys are
not
> guaranteed to any particular order?

No. Unlike the matcher description; this is the error description.

Powered by Google App Engine
This is Rietveld 408576698