ocpsoft / prettytime

Social Style Date and Time Formatting for Java
http://ocpsoft.org/prettytime/
Apache License 2.0
1.29k stars 253 forks source link

Make further java.time changes. #202

Closed Isira-Seneviratne closed 3 years ago

Isira-Seneviratne commented 3 years ago

Fix some issues related to the java.time changes.

lincolnthree commented 3 years ago

Thanks @Isira-Seneviratne - these changes look good. A few good quality improvements in here as well.

lincolnthree commented 3 years ago

Actually, this causes significant test failures (nearly all tests fail, it seems). I believe the default reference time past/future comparison has been inverted by these changes.

Example:

Running org.ocpsoft.prettytime.PrettyTimeTest
Tests run: 46, Failures: 36, Errors: 0, Skipped: 1, Time elapsed: 0.014 sec <<< FAILURE! - in org.ocpsoft.prettytime.PrettyTimeTest
testCeilingInterval(org.ocpsoft.prettytime.PrettyTimeTest)  Time elapsed: 0 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<1 month [ago]> but was:<1 month [from now]>
    at org.junit.Assert.assertEquals(Assert.java:123)
    at org.junit.Assert.assertEquals(Assert.java:145)
    at org.ocpsoft.prettytime.PrettyTimeTest.testCeilingInterval(PrettyTimeTest.java:52)

@Isira-Seneviratne could you run the tests on your end and verify?

lincolnthree commented 3 years ago

Also, apologies for merging this prematurely. It would have been easier for you if I'd left this branch open. GitHub does not appear to allow re-opening merged PRs.