When time is 00:00:00, the Spring.Tests failed

Issue #313 resolved
hezihang created an issue

C:\DelphiComps\spring4d\Tests\Bin\Delphi10Rio\Win32\Release>Spring.Tests

Time: 0:00:00.330

FAILURES!!! Test Results: Run: 1436 Failures: 4 Errors: 0 There were 4 failures: 1) TestStringToDateTime: ETestFailure at "Strings differ at position 10 Expected: 2019/3/17 0:00:00 But was: 2019/3/17 -------------------^" 2) TestStringToNullableDateTime: ETestFailure at "Strings differ at position 10 Expected: 2019/3/17 0:00:00 But was: 2019/3/17 -------------------^" 3) TestWStringToDateTime: ETestFailure at "Strings differ at position 10 Expected: 2019/3/17 0:00:00 But was: 2019/3/17 -------------------^" 4) TestWStringToNullableDateTime: ETestFailure at "Strings differ at position 10 Expected: 2019/3/17 0:00:00 But was: 2019/3/17 -------------------^"

Comments (3)

  1. Stefan Glienke repo owner

    FWIW this is caused by the fact that when it is midnight DateTimeToStr omits the time from its result. Furthermore it does not contain milliseconds either. So technically the converter being used here are not 100% accurate as they will lose the millisecond part anyway when converting back and forth. However that is what you can optionally pass a custom format string to the converter.

    I am inclined to not take any action on this

  2. Log in to comment