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

2 years ago
package startimer
2 years ago
import (
"fmt"
"testing"
"time"
)
2 years ago
func TestParseCron(t *testing.T) {
2 years ago
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)
}
2 years ago
}