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

Issue 8302012: Move test(), group(), and expect() to top level. (Closed)

Created:
9 years, 2 months ago by Bob Nystrom
Modified:
9 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Move test(), group(), and expect() to top level. Instead of being methods on UnitTestSuite, they will automatically create one if there isn't already one, then run it. This lets you define tests just like: main() { test('not crazy', () { expect(sky) == blue; }); } Committed: https://code.google.com/p/dart/source/detail?r=490

Patch Set 1 #

Patch Set 2 : Remove unneeded explicit suite. #

Total comments: 1

Patch Set 3 : Rebase from master. #

Patch Set 4 : Respond to review. #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+326 lines, -304 lines) Patch
M client/testing/unittest/unittestsuite.dart View 1 2 3 11 chunks +136 lines, -99 lines 8 comments Download
D client/tests/client/view/ViewTests.dart View 1 2 1 chunk +0 lines, -202 lines 0 comments Download
M client/tests/client/view/view_tests.dart View 1 2 1 chunk +190 lines, -3 lines 1 comment Download

Messages

Total messages: 7 (0 generated)
Bob Nystrom
This is one step away from having to put all tests inside UnitTestSuite classes.
9 years, 2 months ago (2011-10-14 22:07:27 UTC) #1
Siggi Cherem (dart-lang)
lgtm http://codereview.chromium.org/8302012/diff/3001/client/testing/unittest/unittestsuite.dart File client/testing/unittest/unittestsuite.dart (right): http://codereview.chromium.org/8302012/diff/3001/client/testing/unittest/unittestsuite.dart#newcode110 client/testing/unittest/unittestsuite.dart:110: void addAsyncTest(TestFunction body, int callbacks) { I'm not ...
9 years, 2 months ago (2011-10-14 23:26:29 UTC) #2
Siggi Cherem (dart-lang)
just to put here what we discussed: it seems that this might not work if ...
9 years, 2 months ago (2011-10-14 23:38:34 UTC) #3
Bob Nystrom
On 2011/10/14 23:38:34, sigmund wrote: > just to put here what we discussed: it seems ...
9 years, 2 months ago (2011-10-15 01:28:09 UTC) #4
Siggi Cherem (dart-lang)
lgtm nice! http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unittestsuite.dart File client/testing/unittest/unittestsuite.dart (right): http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unittestsuite.dart#newcode58 client/testing/unittest/unittestsuite.dart:58: // Immediately queue the suite up. It ...
9 years, 2 months ago (2011-10-17 23:23:50 UTC) #5
Anton Muhin
Sorry for late response---we had offsite and I was OOO. http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unittestsuite.dart File client/testing/unittest/unittestsuite.dart (right): http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unittestsuite.dart#newcode93 ...
9 years, 2 months ago (2011-10-18 06:41:53 UTC) #6
Bob Nystrom
9 years, 2 months ago (2011-10-18 17:37:51 UTC) #7
Thanks for this. I'll send these changes out in a separate patch once I've got
it rebased and all.

http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unit...
File client/testing/unittest/unittestsuite.dart (right):

http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unit...
client/testing/unittest/unittestsuite.dart:93: test(null, body);
On 2011/10/18 06:41:53, antonmuhin wrote:
> if you don't want to allow chaining, you probably should modify return type as
> well.

Good catch. Fixed!

http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unit...
client/testing/unittest/unittestsuite.dart:293: _currentSuite._tests.length + 1,
_fullSpec(spec), body, callbacks);
On 2011/10/18 06:41:53, antonmuhin wrote:
> nit: two more spaces?

Done.

http://codereview.chromium.org/8302012/diff/7001/client/testing/unittest/unit...
client/testing/unittest/unittestsuite.dart:345: return false;
On 2011/10/18 06:41:53, antonmuhin wrote:
> apparently we never check return value.  Maybe remove those true/false and
> introduce them then we really need them?

Done. That was some old code from a different style that I was trying. Not
needed any more. :)

Powered by Google App Engine
This is Rietveld 408576698