Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for parseLenientDateTime #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GKFX
Copy link
Contributor

@GKFX GKFX commented Sep 29, 2017

As requested for #36.

@bodewig
Copy link
Member

bodewig commented Sep 30, 2017

Many thanks.

I've fixed the line-ends to contain line-feeds only as I couldn't merge your patch on a Linux box, therefore the PR now has conflicts. Sorry about that.

As written the tests depend on the timezone of the machine running the tests:

Testcase: testLenientDateTime took 0,006 sec
	FAILED
expected:<1488622440000> but was:<1488618840000>
junit.framework.AssertionFailedError: expected:<1488622440000> but was:<1488618840000>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:743)
	at org.junit.Assert.assertEquals(Assert.java:118)
	at org.junit.Assert.assertEquals(Assert.java:555)
	at org.junit.Assert.assertEquals(Assert.java:542)
	at org.apache.tools.ant.util.DateUtilsTest.testLenientDateTime(DateUtilsTest.java:119)

this is on GMT+2 and off by an hour. But as this is off by an hour I think it is more about me being in daylight saving time right now while the date you picked was not (most countries of the EU switch on the last weekends of March and October).

@GKFX
Copy link
Contributor Author

GKFX commented Oct 2, 2017

That's interesting; since the values I were testing were coming out GMT, and I'm in British Summer Time at the moment, I thought the timezone was being set to UTC and so it would work everywhere. Apparently not, so I'll make a note in the documentation.

@bodewig
Copy link
Member

bodewig commented Oct 2, 2017

I haven't found the time to dig deeply into the issue, but it would be good to understand where exactly things turn into unexpected directions.

@GKFX
Copy link
Contributor Author

GKFX commented Oct 2, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants