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

Issue 10579008: Added test setup/teardown. (Closed)

Created:
8 years, 6 months ago by gram
Modified:
8 years, 6 months ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added test setup/teardown. Made default matcher isTrue. Made the exception matchers work with dart2js. Added isIn matcher. equals() now recurses. Committed: https://code.google.com/p/dart/source/detail?r=8951

Patch Set 1 #

Total comments: 19

Patch Set 2 : #

Total comments: 8

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+525 lines, -219 lines) Patch
M lib/unittest/collection_matchers.dart View 1 3 chunks +20 lines, -14 lines 0 comments Download
M lib/unittest/core_matchers.dart View 1 2 4 chunks +266 lines, -118 lines 0 comments Download
M lib/unittest/description.dart View 1 1 chunk +8 lines, -1 line 0 comments Download
M lib/unittest/expect.dart View 1 2 chunks +33 lines, -46 lines 0 comments Download
M lib/unittest/map_matchers.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/unittest/string_matchers.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/unittest/test_case.dart View 1 3 chunks +23 lines, -3 lines 0 comments Download
M lib/unittest/unittest.dart View 1 2 3 4 8 chunks +51 lines, -8 lines 0 comments Download
M tests/json/json_test.dart View 1 2 chunks +16 lines, -22 lines 0 comments Download
M tests/lib/unittest/matchers_test.dart View 1 8 chunks +106 lines, -5 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
gram
8 years, 6 months ago (2012-06-18 23:35:42 UTC) #1
Bob Nystrom
Mostly looks good, mainly just an API design question. http://codereview.chromium.org/10579008/diff/1/lib/unittest/collection_matchers.dart File lib/unittest/collection_matchers.dart (right): http://codereview.chromium.org/10579008/diff/1/lib/unittest/collection_matchers.dart#newcode53 lib/unittest/collection_matchers.dart:53: ...
8 years, 6 months ago (2012-06-19 23:38:33 UTC) #2
gram
PTAL http://codereview.chromium.org/10579008/diff/1/lib/unittest/collection_matchers.dart File lib/unittest/collection_matchers.dart (right): http://codereview.chromium.org/10579008/diff/1/lib/unittest/collection_matchers.dart#newcode53 lib/unittest/collection_matchers.dart:53: Matcher _matcher; On 2012/06/19 23:38:33, Bob Nystrom wrote: ...
8 years, 6 months ago (2012-06-20 17:44:14 UTC) #3
Sean Eagan
Looks great!
8 years, 6 months ago (2012-06-20 17:58:40 UTC) #4
Sean Eagan
https://chromiumcodereview.appspot.com/10579008/diff/1/lib/unittest/core_matchers.dart File lib/unittest/core_matchers.dart (right): https://chromiumcodereview.appspot.com/10579008/diff/1/lib/unittest/core_matchers.dart#newcode552 lib/unittest/core_matchers.dart:552: Thanks for adding this! Just a small gripe, I ...
8 years, 6 months ago (2012-06-20 18:00:22 UTC) #5
gram
Unfortunately 'in' is a reserved word so we can't use it. On 2012/06/20 18:00:22, seaneagan1 ...
8 years, 6 months ago (2012-06-20 18:01:49 UTC) #6
Sean Eagan
On 2012/06/20 18:01:49, gram wrote: > Unfortunately 'in' is a reserved word so we can't ...
8 years, 6 months ago (2012-06-20 18:37:06 UTC) #7
gram
On 2012/06/20 18:37:06, seaneagan1 wrote: > On 2012/06/20 18:01:49, gram wrote: > > Unfortunately 'in' ...
8 years, 6 months ago (2012-06-20 18:45:06 UTC) #8
Sean Eagan
On 2012/06/20 18:45:06, gram wrote: > On 2012/06/20 18:37:06, seaneagan1 wrote: > > On 2012/06/20 ...
8 years, 6 months ago (2012-06-20 19:57:29 UTC) #9
gram
On 2012/06/20 19:57:29, seaneagan1 wrote: > On 2012/06/20 18:45:06, gram wrote: > > On 2012/06/20 ...
8 years, 6 months ago (2012-06-20 20:03:39 UTC) #10
Bob Nystrom
A couple of nits, but LGTM after you re-upload the changes to core_matchers.dart. https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unittest.dart File ...
8 years, 6 months ago (2012-06-20 20:21:22 UTC) #11
gram
8 years, 6 months ago (2012-06-20 21:11:47 UTC) #12
https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unitte...
File lib/unittest/unittest.dart (right):

https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unitte...
lib/unittest/unittest.dart:519: [Function setupTest, Function teardownTest]) {
On 2012/06/20 20:21:22, Bob Nystrom wrote:
> Since you added setUp() and tearDown(), do you still think it's useful to have
> these here too?

Done.

https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unitte...
lib/unittest/unittest.dart:552: * are nested only the most locally scoped
[setUp] function will be run.
On 2012/06/20 20:21:22, Bob Nystrom wrote:
> It might be useful at some point to actually allow nested setups and call all
of
> them (probably outermost first for setup and innermost first for teardown).

I think this could be tricky. There may be cases where people want the the outer
ones run only once for the group, not once per inner test. The inner ones can
always call the outer ones so I think this restriction is okay.

https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unitte...
lib/unittest/unittest.dart:557: void setUp(Function setupTest) {
On 2012/06/20 20:21:22, Bob Nystrom wrote:
> Remove blank line above this.

Done.

https://chromiumcodereview.appspot.com/10579008/diff/5001/lib/unittest/unitte...
lib/unittest/unittest.dart:569: void tearDown(Function teardownTest) {
On 2012/06/20 20:21:22, Bob Nystrom wrote:
> Remove blank line above this.

Done.

Powered by Google App Engine
This is Rietveld 408576698