diff --git a/gocron_test.go b/gocron_test.go index cd0afc0..fea96fa 100644 --- a/gocron_test.go +++ b/gocron_test.go @@ -2,23 +2,24 @@ package gocron import ( - "fmt" "testing" "time" + "fmt" ) var err = 1 -func task() string { - return "I am a running job." +func task() { + fmt.Println("I am a running job.") } -func taskWithParams(a int, b string) (a_ int, b_ string) { - return a, b +func taskWithParams(a int, b string) { + fmt.Println(a, b) } func TestSecond(*testing.T) { - now := time.Now() - default_scheduler.Every(1).Second().Do(task) - default_scheduler.Every(1).Second().Do(taskWithParams, 1, "hello") + defaultScheduler.Every(1).Second().Do(task) + defaultScheduler.Every(1).Second().Do(taskWithParams, 1, "hello") + defaultScheduler.Start() + time.Sleep(10 * time.Second) }