Browse Source

spec_test.go: ensure an error is returned on 0 increment

Fixes issue #144
Rob Figueiredo 6 years ago
parent
commit
eeecf15
1 changed files with 9 additions and 0 deletions
  1. 9 0
      spec_test.go

+ 9 - 0
spec_test.go

@@ -263,3 +263,12 @@ func getTimeTZ(value string) time.Time {
 
 	return t
 }
+
+// https://github.com/robfig/cron/issues/144
+func TestSlash0NoHang(t *testing.T) {
+	schedule := "TZ=America/New_York 15/0 * * * *"
+	_, err := ParseStandard(schedule)
+	if err == nil {
+		t.Error("expected an error on 0 increment")
+	}
+}