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.
startimer/cron_test.go

20 lines
287 B
Go

package startimer
import (
"fmt"
"testing"
"time"
)
func TestParseCron(t *testing.T) {
r, err := NewTimerWithSecCron("0 */4 * * * *")
if err != nil {
t.Fatal(err)
}
base := time.Now()
for i := 0; i < 20; i++ {
base = r.NextTimerAfterDate(base)
fmt.Println(base)
}
}