From 5eb59878cb72ebd48ae361af39c32b955c698170 Mon Sep 17 00:00:00 2001 From: starainrt Date: Tue, 16 May 2023 16:54:53 +0800 Subject: [PATCH] add test --- cron_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cron_test.go b/cron_test.go index f0fd0db..be46515 100644 --- a/cron_test.go +++ b/cron_test.go @@ -1,7 +1,19 @@ package startimer -import "testing" +import ( + "fmt" + "testing" + "time" +) func TestParseCron(t *testing.T) { - parseCron("0 */4 * * * *") + 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) + } }