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

Issue 149573006: pkg/unittest: more lock-down, cleanup (Closed)

Created:
6 years, 10 months ago by kevmoo
Modified:
6 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

pkg/unittest: more lock-down, cleanup TestCase: cannot set 'enabled' directly. Use enable/disableTest top-level method TestCase: pass, fail, error are now private Tests for protectAsyncN Moved private helper classes into their own files html_enhanced_config: fixed usage of deprecated query apis R=sigmund@google.com Committed: https://code.google.com/p/dart/source/detail?r=32255

Patch Set 1 #

Total comments: 9

Patch Set 2 : long line #

Patch Set 3 : long line #

Patch Set 4 : fighting cl #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -208 lines) Patch
pkg/unittest/lib/html_enhanced_config.dart View 1 3 chunks +8 lines, -7 lines 0 comments Download
A pkg/unittest/lib/src/group_context.dart View 1 chunk +67 lines, -0 lines 0 comments Download
A pkg/unittest/lib/src/spread_args_helper.dart View 1 chunk +123 lines, -0 lines 0 comments Download
M pkg/unittest/lib/src/test_case.dart View 4 chunks +9 lines, -7 lines 0 comments Download
M pkg/unittest/lib/unittest.dart View 7 chunks +8 lines, -194 lines 0 comments Download
pkg/unittest/test/unittest_async_exception2_test.dart View 1 chunk +43 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
kevmoo
6 years, 10 months ago (2014-02-03 17:34:58 UTC) #1
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/html_enhanced_config.dart File pkg/unittest/lib/html_enhanced_config.dart (right): https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/html_enhanced_config.dart#newcode210 pkg/unittest/lib/html_enhanced_config.dart:210: var grp = (safeGroup == '') ? null ...
6 years, 10 months ago (2014-02-03 18:09:46 UTC) #2
kevmoo
https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/html_enhanced_config.dart File pkg/unittest/lib/html_enhanced_config.dart (right): https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/html_enhanced_config.dart#newcode210 pkg/unittest/lib/html_enhanced_config.dart:210: var grp = (safeGroup == '') ? null : ...
6 years, 10 months ago (2014-02-03 18:22:56 UTC) #3
kevmoo
Committed patchset #4 manually as r32255 (presubmit successful).
6 years, 10 months ago (2014-02-03 18:24:24 UTC) #4
Siggi Cherem (dart-lang)
6 years, 10 months ago (2014-02-03 22:54:39 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/unittest.dart
File pkg/unittest/lib/unittest.dart (right):

https://codereview.chromium.org/149573006/diff/1/pkg/unittest/lib/unittest.da...
pkg/unittest/lib/unittest.dart:322: // TODO(sigmund): deprecate this API when
issue 2706 is fixed.
On 2014/02/03 18:22:57, kevmoo wrote:
> On 2014/02/03 18:09:46, Siggi Cherem (dart-lang) wrote:
> > BTW - now that 2706 is fixed, we can fix up a bit this API. 
> > 
> > I tried once using some generic 'call' method on a class, but that was not
> > really working. However, in another CL I just noticed a trick we can
probably
> > use to merge expectAsync0/1/2 in a single expectAsync.
> > 
> > Here is the trick:
> > 
> > typedef _Func2(a, b);
> > typedef _Func1(a);
> > typedef _Func0();
> > 
> > Function expectAsync(callback, ...) {
> >   var helper = new _SpreadArgsHelper(...);
> >   if (callback is _Func2) return helper.invoke2;
> >   if (callback is _Func1) return helper.invoke1;
> >   if (callback is _Func0) return helper.invoke0;
> > }
> > 
> > We could even add more options (like definitions that accept optional
> arguments
> > and everything!)
> 
> I tried this awhile ago and failed because of checked mode not liking classes
> with call method in some contexts. Certainly a place to investigate. ... in
> another CL :-)

yeah - exactly, I remember trying and failing with that too, but if we don't
generalize it to support named arguments, and just focus on merging the 3 apis
here, I think we can do it with the trick above :)

Powered by Google App Engine
This is Rietveld 408576698