forked from mirrors/org-mode
org-timer: Fix timer setting from effort property
Testcase included.
This commit is contained in:
parent
acabacaa56
commit
2b5ce91b35
|
@ -436,7 +436,7 @@ using three `C-u' prefix arguments."
|
|||
(if (numberp org-timer-default-timer)
|
||||
(number-to-string org-timer-default-timer)
|
||||
org-timer-default-timer))
|
||||
(effort-minutes (ignore-errors (org-get-at-eol 'effort-minutes 1)))
|
||||
(effort-minutes (ignore-errors (floor (org-get-at-eol 'effort-minutes 1))))
|
||||
(minutes (or (and (numberp opt) (number-to-string opt))
|
||||
(and (not (equal opt '(64)))
|
||||
effort-minutes
|
||||
|
|
|
@ -279,5 +279,21 @@ Also, mute output from `message'."
|
|||
(org-timer-start))
|
||||
:type (list 'error 'user-error)))
|
||||
|
||||
(ert-deftest test-org-timer/set-timer-from-effort-prop ()
|
||||
"Test timer setting from effort property."
|
||||
(should
|
||||
(< (* 60 9) ; 9m
|
||||
(test-org-timer/with-temp-text
|
||||
"* foo
|
||||
:PROPERTIES:
|
||||
:Effort: 10
|
||||
:END:"
|
||||
(org-mode)
|
||||
(org-timer-set-timer)
|
||||
(org-timer-hms-to-secs (org-timer nil t)))
|
||||
(1+ (* 60 10)) ; 10m 1s
|
||||
)))
|
||||
|
||||
|
||||
(provide 'test-org-timer)
|
||||
;;; test-org-timer.el end here
|
||||
|
|
Loading…
Reference in a new issue