You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gojobs/cron_spec_test.go

27 lines
965 B

2 years ago
package gojobs
import "testing"
func TestSpec(t *testing.T) {
2 years ago
t.Log("每隔10秒执行一次", GetSeconds(10).Spec())
t.Log("每隔10秒执行一次", GetSeconds(10).Frequency())
2 years ago
2 years ago
t.Log("每隔60秒执行一次", GetSeconds(60).Spec())
t.Log("每隔60秒执行一次", GetSeconds(60).Frequency())
2 years ago
2 years ago
t.Log("每隔5分钟执行一次", GetMinutes(5).Spec())
t.Log("每隔5分钟执行一次", GetMinutes(5).Frequency())
2 years ago
2 years ago
t.Log("每隔10分钟执行一次", GetMinutes(10).Spec())
t.Log("每隔10分钟执行一次", GetMinutes(10).Frequency())
2 years ago
2 years ago
t.Log("每隔60分钟执行一次", GetMinutes(60).Spec())
t.Log("每隔60分钟执行一次", GetMinutes(60).Frequency())
t.Log("每天n点执行一次", GetHour(10).Spec())
t.Log("每天n点执行一次", GetHour(10).Frequency())
t.Log("每隔n小时执行一次", GetHourInterval(1).Spec())
t.Log("每隔n小时执行一次", GetHourInterval(1).Frequency())
2 years ago
}