0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-16 15:01:07 +01:00

Fix test cases

This commit is contained in:
Unknown 2014-06-16 23:19:25 -04:00
parent d952b4200c
commit 8d3276cab0

View file

@ -154,9 +154,9 @@ func TestRunningMultipleSchedules(t *testing.T) {
cron.AddFunc("", "0 0 0 1 1 ?", func() {}) cron.AddFunc("", "0 0 0 1 1 ?", func() {})
cron.AddFunc("", "0 0 0 31 12 ?", func() {}) cron.AddFunc("", "0 0 0 31 12 ?", func() {})
cron.AddFunc("", "* * * * * ?", func() { wg.Done() }) cron.AddFunc("", "* * * * * ?", func() { wg.Done() })
cron.Schedule("", Every(time.Minute), FuncJob(func() {})) cron.Schedule("", "", Every(time.Minute), FuncJob(func() {}))
cron.Schedule("", Every(time.Second), FuncJob(func() { wg.Done() })) cron.Schedule("", "", Every(time.Second), FuncJob(func() { wg.Done() }))
cron.Schedule("", Every(time.Hour), FuncJob(func() {})) cron.Schedule("", "", Every(time.Hour), FuncJob(func() {}))
cron.Start() cron.Start()
defer cron.Stop() defer cron.Stop()
@ -208,8 +208,8 @@ func TestJob(t *testing.T) {
cron.AddJob("", "0 0 0 1 1 ?", testJob{wg, "job1"}) cron.AddJob("", "0 0 0 1 1 ?", testJob{wg, "job1"})
cron.AddJob("", "* * * * * ?", testJob{wg, "job2"}) cron.AddJob("", "* * * * * ?", testJob{wg, "job2"})
cron.AddJob("", "1 0 0 1 1 ?", testJob{wg, "job3"}) cron.AddJob("", "1 0 0 1 1 ?", testJob{wg, "job3"})
cron.Schedule("", Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"}) cron.Schedule("", "", Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"})
cron.Schedule("", Every(5*time.Minute), testJob{wg, "job5"}) cron.Schedule("", "", Every(5*time.Minute), testJob{wg, "job5"})
cron.Start() cron.Start()
defer cron.Stop() defer cron.Stop()