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

Issue 10804014: Temporal assertion support. (Closed)

Created:
8 years, 5 months ago by gram
Modified:
8 years, 5 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Temporal assertion support. Committed: https://code.google.com/p/dart/source/detail?r=9769

Patch Set 1 #

Total comments: 19

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+887 lines, -55 lines) Patch
M lib/unittest/mock.dart View 1 27 chunks +454 lines, -54 lines 2 comments Download
M tests/lib/unittest/unittest_test.dart View 4 chunks +433 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
gram
8 years, 5 months ago (2012-07-18 21:40:01 UTC) #1
Siggi Cherem (dart-lang)
http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart File lib/unittest/mock.dart (right): http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart#newcode353 lib/unittest/mock.dart:353: get first() { we might fit this in a ...
8 years, 5 months ago (2012-07-19 18:05:00 UTC) #2
gram
PTAL. http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart File lib/unittest/mock.dart (right): http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart#newcode353 lib/unittest/mock.dart:353: get first() { On 2012/07/19 18:05:00, sigmund wrote: ...
8 years, 5 months ago (2012-07-19 18:52:19 UTC) #3
Siggi Cherem (dart-lang)
8 years, 5 months ago (2012-07-19 20:02:25 UTC) #4
lgtm!

http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart
File lib/unittest/mock.dart (right):

http://codereview.chromium.org/10804014/diff/1/lib/unittest/mock.dart#newcode627
lib/unittest/mock.dart:627: LogEntryList fromLast(LogEntryList segment, [bool
inPlace = false]) =>
On 2012/07/19 18:52:19, gram wrote:
> On 2012/07/19 18:05:00, sigmund wrote:
> > we should clarify on these comments the edge conditions. E.g. does this
> include
> > segment.last? Can we select the behaviour (e.g. a boolean argument to
specify
> > whether to include it or not?)
> 
> segment here need not have any elements in common with the logs being
inspected;
> we are using it just to get a timestamp. So it doesn't make sense to include
> that element in the output as it may or may not exist.
> 
> The comment is unambiguous, I think:
> 
> Returns log events that happened from the TIME of the last event in [segment]
> onwards.
> 
> These are just versions of before/after/until/from (which all take Dates) but
we
> are getting the date from a log which was most likely the result of some prior
> filtering step.
> 
> A typical use case might be finding the calls to some error function in the
logs
> from one mock, and then finding the calls to some related method that preceded
> these in a different mock (where each mock has its own log).
> 
> I do plan on expanding the mock article next week with some info on these with
> use cases so that should make things more clear. 

Thanks for the clarification, it makes a lot of sense

http://codereview.chromium.org/10804014/diff/2002/lib/unittest/mock.dart
File lib/unittest/mock.dart (right):

http://codereview.chromium.org/10804014/diff/2002/lib/unittest/mock.dart#newc...
lib/unittest/mock.dart:754: *          logFilter:
callsTo('process')).toString());
Awesome example!
The print/toString was slighly distracting for me here, maybe we can trim the
example? For instance,

failingProcess = log.preceding(
    log.getLogs(callsTo('commit'), returning(-1)),
    logFilter: callsTo('process'));

http://codereview.chromium.org/10804014/diff/2002/lib/unittest/mock.dart#newc...
lib/unittest/mock.dart:764: *         distance: 3).toString());
ditto

Powered by Google App Engine
This is Rietveld 408576698