Skip to content

Fix/failing tests#613

Open
ArisOIKON wants to merge 2 commits into
dhatim:masterfrom
ArisOIKON:fix/failing-tests
Open

Fix/failing tests#613
ArisOIKON wants to merge 2 commits into
dhatim:masterfrom
ArisOIKON:fix/failing-tests

Conversation

@ArisOIKON
Copy link
Copy Markdown

Summary

Fixes CorrectnessTest.testForOffBy1ErrorFor1900_utilDate which
fails on non-UTC timezones (e.g. UTC+2, UTC+3, etc).

Root Cause

The test asserted hardcoded Excel serial numbers (e.g. 1.0, 367.0)
against convertDate(Date), which explicitly uses the system
timezone by design (as documented in its Javadoc). On non-UTC
machines, midnight in the local timezone converts to a fractional
serial number rather than a whole number.

Fix

Instead of asserting hardcoded values (1.0, 367.0), the test now verifies that
convertDate(Date) is consistent with convertDate(LocalDate)
using the same system timezone (what the method actually
guarantees).

Testing

Verified passing on UTC+3 (Greece) where the test previously failed. All testing is now succesful.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 88.719%. remained the same — ArisOIKON:fix/failing-tests into dhatim:master

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