You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
426 B
Go
27 lines
426 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestGetAllThursdays(t *testing.T) {
|
|
tt, err := time.Parse("2006-01-02", "2017-12-07")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
dates := GetAllThursdays(tt, time.Now())
|
|
|
|
if dates[0] != NextThursday(tt) {
|
|
t.Error("starting date")
|
|
}
|
|
|
|
t.Log(NextThursday(time.Now()))
|
|
t.Log(dates[len(dates)-1])
|
|
|
|
if dates[len(dates)-1] != NextThursday(time.Now()) {
|
|
t.Error("end date")
|
|
}
|
|
}
|