iSoron / uhabits

Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits
GNU General Public License v3.0
7.47k stars 916 forks source link

DateUtilsTest. getWeekdaysInMonth[jvm] test failing #1941

Closed foralost closed 2 months ago

foralost commented 4 months ago

Pre-submission checklist

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

Screenshots

Calendar 2018 February: image

Source of error: image

And the rest of calendar tests