v0.0.509
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 6m2s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 6m2s
This commit is contained in:
@@ -191,3 +191,39 @@ func TestCombineDateAndTime_CombineDifferentParts(t *testing.T) {
|
||||
t.Errorf("Expected %v, got %v", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDaysInMonth_31Days(t *testing.T) {
|
||||
date := time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC) // January
|
||||
expected := 31
|
||||
result := DaysInMonth(date)
|
||||
if result != expected {
|
||||
t.Errorf("Expected %d but got %d", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDaysInMonth_30Days(t *testing.T) {
|
||||
date := time.Date(2022, 4, 1, 0, 0, 0, 0, time.UTC) // April
|
||||
expected := 30
|
||||
result := DaysInMonth(date)
|
||||
if result != expected {
|
||||
t.Errorf("Expected %d but got %d", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDaysInMonth_FebruaryLeapYear(t *testing.T) {
|
||||
date := time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC) // February in a leap year
|
||||
expected := 29
|
||||
result := DaysInMonth(date)
|
||||
if result != expected {
|
||||
t.Errorf("Expected %d but got %d", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDaysInMonth_FebruaryNonLeapYear(t *testing.T) {
|
||||
date := time.Date(2021, 2, 1, 0, 0, 0, 0, time.UTC) // February in a non-leap year
|
||||
expected := 28
|
||||
result := DaysInMonth(date)
|
||||
if result != expected {
|
||||
t.Errorf("Expected %d but got %d", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user