Skip to content

Commit

Permalink
Fix tests for org-parse-time-string' and org-clock'
Browse files Browse the repository at this point in the history
* testing/lisp/test-org.el (ert-deftest test-org/org-parse-time-string):
Update test expectations to use DST of -1 (guess) after fix of
`org-parse-time-string'.
* testing/lisp/test-org-clock.el (org-test-clock-create-timestamp):
Do not change timezone from nil to 0.  Prevent test failures in zones
other than UTC.
  • Loading branch information
maxnikulin authored and yantar92 committed Jul 17, 2022
1 parent 132a9d3 commit a189697
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions testing/lisp/test-org-clock.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Return the timestamp as a string."
(org-element-interpret-data
(let ((time (decode-time
(apply #'encode-time
(mapcar (lambda (el) (or el 0))
(org-read-date-analyze
input nil (decode-time (current-time))))))))
(org-fix-decoded-time
(org-read-date-analyze
input nil (decode-time (current-time))))))))
(list 'timestamp
(list :type (if inactive 'inactive 'active)
:minute-start (and with-time (nth 1 time))
Expand Down
10 changes: 5 additions & 5 deletions testing/lisp/test-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@
(ert-deftest test-org/org-parse-time-string ()
"Test `org-parse-time-string'."
(should (equal (org-parse-time-string "2012-03-29 16:40")
'(0 40 16 29 3 2012 nil nil nil)))
'(0 40 16 29 3 2012 nil -1 nil)))
(should (equal (org-parse-time-string "[2012-03-29 16:40]")
'(0 40 16 29 3 2012 nil nil nil)))
'(0 40 16 29 3 2012 nil -1 nil)))
(should (equal (org-parse-time-string "<2012-03-29 16:40>")
'(0 40 16 29 3 2012 nil nil nil)))
'(0 40 16 29 3 2012 nil -1 nil)))
(should (equal (org-parse-time-string "<2012-03-29>")
'(0 0 0 29 3 2012 nil nil nil)))
'(0 0 0 29 3 2012 nil -1 nil)))
(should (equal (org-parse-time-string "<2012-03-29>" t)
'(0 nil nil 29 3 2012 nil nil nil))))
'(0 nil nil 29 3 2012 nil -1 nil))))

(ert-deftest test-org/closest-date ()
"Test `org-closest-date' specifications."
Expand Down

0 comments on commit a189697

Please sign in to comment.