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

Issue 1511773003: Fix datetime test. (Closed)

Created:
5 years ago by floitsch
Modified:
5 years ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M tests/corelib/date_time_test.dart View 1 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
floitsch
5 years ago (2015-12-09 06:19:29 UTC) #2
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/1511773003/diff/1/tests/corelib/date_time_test.dart File tests/corelib/date_time_test.dart (right): https://codereview.chromium.org/1511773003/diff/1/tests/corelib/date_time_test.dart#newcode45 tests/corelib/date_time_test.dart:45: if (!supportsMicroseconds) return; Still don't get why the ...
5 years ago (2015-12-09 14:54:29 UTC) #3
floitsch
https://codereview.chromium.org/1511773003/diff/1/tests/corelib/date_time_test.dart File tests/corelib/date_time_test.dart (right): https://codereview.chromium.org/1511773003/diff/1/tests/corelib/date_time_test.dart#newcode45 tests/corelib/date_time_test.dart:45: if (!supportsMicroseconds) return; On 2015/12/09 14:54:29, Lasse Reichstein Nielsen ...
5 years ago (2015-12-09 19:24:17 UTC) #4
floitsch
Committed patchset #2 (id:20001) manually as 581392cf17f77dcce6c9ee3112e19aa1f91993b3 (presubmit successful).
5 years ago (2015-12-09 19:24:45 UTC) #6
Lasse Reichstein Nielsen
Still don't see how the test can fail, comment doesn't help. You are testing the ...
5 years ago (2015-12-10 08:35:05 UTC) #7
floitsch
5 years ago (2015-12-10 18:46:34 UTC) #8
Message was sent while issue was closed.
On 2015/12/10 08:35:05, Lasse Reichstein Nielsen wrote:
> Still don't see how the test can fail, comment doesn't help.
> 
> You are testing the microsecondsSinceEpoch value of two DateTime instances
where
> the latter is created using DateTime.fromMicrosecondsSinceEpoch with the value
> of the first.
> 
> No matter what, either DateTime truncates the value for the first instance, in
> which case both values read using microsecondsSinceEpoch will be truncated, or
> the first will not truncate - and then so won't the second.
> 
> The only way this can fail is if DateTime.now creates a value with
microseconds
> and microsecondsSinceEpoch returns that, but
DateTime.fromMicrosecondsSinceEpoch
> then truncates that value.

That's what I was protecting against. Yes.
But you are right. We would need to go a bit into the future before this becomes
a problem.
Will update the test.

Powered by Google App Engine
This is Rietveld 408576698