iSoron / uhabits

Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DateUtilsTest. getWeekdaysInMonth[jvm] test failing

foralost opened this issue · comments

Pre-submission checklist

  • I am submitting a bug report, not a feature request.
  • I have searched for similar issues, but did not find any matches.

Description

During the execution of DateUtilsTest. getWeekdaysInMonth[jvm], the test fails. The rough description of the test is:

java.lang.AssertionError: 
Expected: [<4>, <4>, <4>, <4>, <5>, <5>, <5>]
     but: was [<4>, <4>, <4>, <4>, <4>, <4>, <4>]
...

I checked this test, and indeed, Febraury 2018 has different set of weekdays (4 mon, 4 tues, 4 weds, 4 fris, 4 sat, 4 suns).
The problem is that GregorianCalendar returns Time Zone dependent date, and in my case it was returning a one day before actual date.

Steps to reproduce

Run ./build.sh build debug command

System information

  • Any (CI issue)

Screenshots

Calendar 2018 February:
image

Source of error:
image

And the rest of calendar tests