job-specifier: Check 'job'

* tests/job-specifier.scm ("job: procedure timeproc")
("job: list timeproc", "job: string timeproc", "job: list action")
("job: invalid string timeproc", "job: invalid timeproc")
("job: procedure action", "job: string action")
("job: user name"): New tests.
This commit is contained in:
Mathieu Lirzin 2018-03-27 00:23:37 +02:00
commit 8ab0465d92
No known key found for this signature in database
GPG key ID: 0ADEE10094604D37

View file

@ -132,4 +132,41 @@
#t
(set-configuration-user 'wrong))
;;;
;;; Check the 'job' procedure
;;;
(test-assert "job: procedure timeproc"
(job 1+ "dummy action"))
(test-assert "job: list timeproc"
(job '(next-hour '(0)) "dummy action"))
(test-assert "job: string timeproc"
(job "30 4 1,15 * 5" "dummy action"))
(test-error "job: invalid string timeproc"
'mcron-error
(job "30 4 1,15 * WRONG" "dummy action"))
(test-error "job: invalid timeproc"
'mcron-error
(job 42 "dummy action"))
(test-assert "job: procedure action"
(job 1+ (λ () (display "hello\n"))))
(test-assert "job: list action"
(job 1+ '(display "hello\n")))
(test-assert "job: string action"
(job 1+ "echo hello"))
(test-error "job: string action"
'mcron-error
(job 1+ 42))
(test-assert "job: user name"
(job 1+ "dummy action" #:user (getuid)))
(test-end)