update
This commit is contained in:
+5
-1
@@ -3,12 +3,16 @@ package when
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestParse(t *testing.T) {
|
||||
for _, code := range []string{"一个小时后告诉我事情", "三个小时后爱我", "每两个小时提醒我吃饭", "每五个月零二十五天三小时25分15秒告诉我时间", "5月23日上午3点24分12秒打我", "周四上午11点提醒我"} {
|
||||
for _, code := range []string{"一个小时后告诉我事情", "三个小时后爱我", "每两个小时提醒我吃饭",
|
||||
"每五个月零二十五天三小时25分15秒告诉我时间", "5月23日上午3点24分12秒打我", "周四上午11点提醒我",
|
||||
"每周一到周五上午8点提醒我吃饭"} {
|
||||
a, _ := WhenWithPeriod(code)
|
||||
//fmt.Println(a.Repeats()[0])
|
||||
fmt.Println(a.NextTimer(), a.RunCountLimit(), code)
|
||||
fmt.Println(a.NextTimerAfterDate(time.Now().Add(time.Hour * 72)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user