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

Issue 12366004: When we have excess callbacks, throw instead of calling error() so that we (Closed)

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

Description

When we have excess callbacks, throw instead of calling error() so that we get a stack trace. Clean up SpreadArgsHelper. We can now specify a min and max count for callbacks. Split onTestResult into two - onTestResult and onTestResultChanged. The first one is called initially, and the second if further callbacks occur after the test was considered complete, or if teardown fails. See https://code.google.com/p/dart/issues/detail?id=8660 Committed: https://code.google.com/p/dart/source/detail?r=19269

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : #

Total comments: 8

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 20

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -239 lines) Patch
M pkg/unittest/lib/src/config.dart View 1 2 3 4 5 6 2 chunks +14 lines, -15 lines 0 comments Download
M pkg/unittest/lib/src/test_case.dart View 1 2 3 4 5 6 1 chunk +28 lines, -30 lines 0 comments Download
M pkg/unittest/lib/unittest.dart View 1 2 3 4 5 6 12 chunks +146 lines, -174 lines 0 comments Download
M pkg/unittest/test/unittest_test.dart View 1 2 3 4 5 6 6 chunks +23 lines, -20 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
gram
7 years, 9 months ago (2013-02-27 22:35:31 UTC) #1
Jennifer Messerly
lgtm! https://codereview.chromium.org/12366004/diff/1/pkg/unittest/lib/unittest.dart File pkg/unittest/lib/unittest.dart (right): https://codereview.chromium.org/12366004/diff/1/pkg/unittest/lib/unittest.dart#newcode440 pkg/unittest/lib/unittest.dart:440: return false; remove?
7 years, 9 months ago (2013-02-27 22:42:55 UTC) #2
Siggi Cherem (dart-lang)
same here: lgtm, but would be great to make the check a void function now.
7 years, 9 months ago (2013-02-27 23:02:21 UTC) #3
gram
Siggy, PTAL. I have reworked SpreadArgsHelper to hopefully be cleaner and more flexible.
7 years, 9 months ago (2013-02-28 01:56:29 UTC) #4
gram
Adding Kevin
7 years, 9 months ago (2013-02-28 17:49:25 UTC) #5
kevmoo-old
I'm seeing a failure after applying your patch to r19251 on a mac FAIL: late ...
7 years, 9 months ago (2013-02-28 18:02:19 UTC) #6
kevmoo-old
Hopefully this is my asserts adding more value than headache...
7 years, 9 months ago (2013-02-28 18:03:37 UTC) #7
Siggi Cherem (dart-lang)
some minor comments, but ow looks nice! https://codereview.chromium.org/12366004/diff/8001/pkg/unittest/lib/unittest.dart File pkg/unittest/lib/unittest.dart (right): https://codereview.chromium.org/12366004/diff/8001/pkg/unittest/lib/unittest.dart#newcode291 pkg/unittest/lib/unittest.dart:291: int _minExpectedCalls; ...
7 years, 9 months ago (2013-02-28 19:29:23 UTC) #8
gram
Added onTestResultChanged handler to config.dart. Made members of SpreadArgsHandler not start with '_' and made ...
7 years, 9 months ago (2013-02-28 22:49:50 UTC) #9
kevmoo-old
lgtm love the API change pkg/unittest tests passed locally
7 years, 9 months ago (2013-02-28 22:54:21 UTC) #10
Siggi Cherem (dart-lang)
https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart File pkg/unittest/lib/src/config.dart (right): https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart#newcode69 pkg/unittest/lib/src/config.dart:69: assert(testCase != null); remove trailing space/tab https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart#newcode78 pkg/unittest/lib/src/config.dart:78: if ...
7 years, 9 months ago (2013-02-28 23:31:53 UTC) #11
kevmoo-old
https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart File pkg/unittest/lib/src/config.dart (right): https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart#newcode78 pkg/unittest/lib/src/config.dart:78: if (currentTestCase == null) { It's now top-level
7 years, 9 months ago (2013-02-28 23:33:47 UTC) #12
Siggi Cherem (dart-lang)
On 2013/02/28 23:33:47, kevmoo wrote: > https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart > File pkg/unittest/lib/src/config.dart (right): > > https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/config.dart#newcode78 > ...
7 years, 9 months ago (2013-02-28 23:34:59 UTC) #13
gram
Committed patchset #7 manually as r19269 (presubmit successful).
7 years, 9 months ago (2013-03-01 00:27:54 UTC) #14
gram
7 years, 9 months ago (2013-03-04 19:51:25 UTC) #15
Message was sent while issue was closed.
Publishing old draft comments

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/confi...
File pkg/unittest/lib/src/config.dart (right):

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/src/confi...
pkg/unittest/lib/src/config.dart:69: assert(testCase != null);
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> remove trailing space/tab

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
File pkg/unittest/lib/unittest.dart (right):

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:303: int testNum;
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> can this be final too?

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:308: Function isDone, String id) :
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> constructor style nits:
> * indent this line only + 4
> * move ':' to the next line, and indent it also +4
> * indent + 2 the line after it. 
> 
> For example:
> 
>   _SpreadArgsHelper(Function callback, int minExpected, int maxExpected,
>       Function isDone, String id)
>       : this.callback = callback,
>         this.minExpectCalls = ... 

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:310: this.minExpectedCalls = minExpected,
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> remove 'this'
> (it is only necessary if the name is different than the argument name.)

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:311: this.maxExpectedCalls = (maxExpected == 0 &&
minExpected > 0) ? minExpected : maxExpected,
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> long line: wrap after before '?'

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:332: // Try to create a reasonable id.
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> by moving this code to a static private function, you can use it in an
> initializer and make 'id' final

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:362: '');
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> nit: move this to the previous line.

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:374: if (minExpectedCalls > 0 && actualCalls <
minExpectedCalls) {
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> nit: if it fits in one line, do the fast-exit pattern here:
> 
> if (minExpectedCalls > 0 && actualCalls < minExpectedCalls) return;
> if (isDone != null && !isDone()) return;

Done.

https://codereview.chromium.org/12366004/diff/9003/pkg/unittest/lib/unittest....
pkg/unittest/lib/unittest.dart:473: * called exactly [count] times. A value of
-1 for [max] will mean no upper
On 2013/02/28 23:31:53, Siggi Cherem (dart-lang) wrote:
> thanks =)

Done.

Powered by Google App Engine
This is Rietveld 408576698