Explorar el Código

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

Fixes issue #144
Rob Figueiredo hace 6 años
padre
commit
eeecf15
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  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")
+	}
+}