Skip to content

Commit

Permalink
another month test
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Oct 22, 2023

Verified

This commit was signed with the committer’s verified signature.
kciesielski Krzysztof Ciesielski
1 parent efd5f8c commit e2bfcd8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions job_test.go
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ func TestMonthlyJob_next(t *testing.T) {
expectedDurationToNextRun time.Duration
}{
{
"same day",
"same day - before at time",
[]int{1},
nil,
[]time.Time{
@@ -64,6 +64,17 @@ func TestMonthlyJob_next(t *testing.T) {
time.Date(2000, 1, 1, 5, 30, 0, 0, time.UTC),
5*time.Hour + 30*time.Minute,
},
{
"same day - after at time, runs next available date",
[]int{1, 10},
nil,
[]time.Time{
time.Date(0, 0, 0, 5, 30, 0, 0, time.UTC),
},
time.Date(2000, 1, 1, 5, 30, 0, 0, time.UTC),
time.Date(2000, 1, 10, 5, 30, 0, 0, time.UTC),
9 * 24 * time.Hour,
},
{
"daylight savings time",
[]int{5},
@@ -87,7 +98,7 @@ func TestMonthlyJob_next(t *testing.T) {
2 * 24 * time.Hour,
},
{
"day not in current month, runs next month",
"day not in current month, runs next month (leap year)",
[]int{31},
nil,
[]time.Time{

0 comments on commit e2bfcd8

Please sign in to comment.