-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package biweekly.issues; | ||
|
||
import static biweekly.util.TestUtils.date; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import biweekly.component.VEvent; | ||
import biweekly.util.DefaultTimezoneRule; | ||
import biweekly.util.Frequency; | ||
import biweekly.util.Recurrence; | ||
import biweekly.util.com.google.ical.compat.javautil.DateIterator; | ||
|
||
/** | ||
* @author Michael Angstadt | ||
* @see "https://github.com/mangstadt/biweekly/issues/130" | ||
*/ | ||
public class Issue130 { | ||
@Rule | ||
public final DefaultTimezoneRule rule = new DefaultTimezoneRule("America/Chicago"); | ||
|
||
@Test | ||
@Ignore | ||
public void test() throws Exception { | ||
Date start = date(2024, 1, 1, 0, 0, 0); | ||
Recurrence rrule = new Recurrence.Builder(Frequency.HOURLY).build(); | ||
|
||
VEvent event = new VEvent(); | ||
event.setDateStart(start); | ||
event.setRecurrenceRule(rrule); | ||
|
||
DateIterator it = event.getDateIterator(TimeZone.getDefault()); | ||
it.advanceTo(date(2024, 1, 31, 18, 0, 0)); | ||
|
||
Date actual = it.next(); //actual: "2024-02-01 00:00" | ||
Date expected = date(2024, 1, 31, 19, 0, 0); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
assertEquals(expected, actual); | ||
} | ||
} |
I believe this should actually be
Date expected = date(2024, 1, 31, 18, 0, 0);