summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-08-20 14:21:21 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-08-20 14:21:21 +0200
commite48fac5231258e3cdef8802fbb0846cfd5cab53c (patch)
treee86830090e5a710c35cfe2bfaac12425cd66abba
parent2befc22b26d27c6b1931f5fb192c1888535c8bb1 (diff)
downloadorg-mode-e48fac5231258e3cdef8802fbb0846cfd5cab53c.tar.gz
Fix failing tests
* testing/lisp/test-org.el (test-org/timestamp-from-string): (test-org/timestamp-from-time): Fix failing tests due to wrong locale.
-rw-r--r--testing/lisp/test-org.el54
1 files changed, 26 insertions, 28 deletions
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index a618da4..215d8fd 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -6824,46 +6824,44 @@ CLOCK: [2012-03-29 Thu 10:00]--[2012-03-29 Thu 16:40] => 6:40"
(should-not (org-timestamp-from-string "<2012-03-29"))
;; Otherwise, return a valid Org timestamp object.
(should
- (equal "<2012-03-29 Thu>"
- (let ((system-time-locale "en_US"))
- (org-element-interpret-data
- (org-timestamp-from-string "<2012-03-29 Thu>")))))
+ (string-match-p "<2012-03-29 .+>"
+ (org-element-interpret-data
+ (org-timestamp-from-string "<2012-03-29 Thu>"))))
(should
- (equal "[2014-03-04 Tue]"
- (let ((system-time-locale "en_US"))
- (org-element-interpret-data
- (org-timestamp-from-string "[2014-03-04 Tue]"))))))
+ (string-match-p "[2014-03-04 .+]"
+ (org-element-interpret-data
+ (org-timestamp-from-string "[2014-03-04 Tue]")))))
(ert-deftest test-org/timestamp-from-time ()
"Test `org-timestamp-from-time' specifications."
;; Standard test.
(should
- (equal "<2012-03-29 Thu>"
- (let ((system-time-locale "en_US"))
- (org-element-interpret-data
- (org-timestamp-from-time
- (apply #'encode-time
- (org-parse-time-string "<2012-03-29 Thu 16:40>")))))))
+ (string-match-p
+ "<2012-03-29 .+>"
+ (org-element-interpret-data
+ (org-timestamp-from-time
+ (apply #'encode-time
+ (org-parse-time-string "<2012-03-29 Thu 16:40>"))))))
;; When optional argument WITH-TIME is non-nil, provide time
;; information.
(should
- (equal "<2012-03-29 Thu 16:40>"
- (let ((system-time-locale "en_US"))
- (org-element-interpret-data
- (org-timestamp-from-time
- (apply #'encode-time
- (org-parse-time-string "<2012-03-29 Thu 16:40>"))
- t)))))
+ (string-match-p
+ "<2012-03-29 .+ 16:40>"
+ (org-element-interpret-data
+ (org-timestamp-from-time
+ (apply #'encode-time
+ (org-parse-time-string "<2012-03-29 Thu 16:40>"))
+ t))))
;; When optional argument INACTIVE is non-nil, return an inactive
;; timestamp.
(should
- (equal "[2012-03-29 Thu]"
- (let ((system-time-locale "en_US"))
- (org-element-interpret-data
- (org-timestamp-from-time
- (apply #'encode-time
- (org-parse-time-string "<2012-03-29 Thu 16:40>"))
- nil t))))))
+ (string-match-p
+ "[2012-03-29 .+]"
+ (org-element-interpret-data
+ (org-timestamp-from-time
+ (apply #'encode-time
+ (org-parse-time-string "<2012-03-29 Thu 16:40>"))
+ nil t)))))
(ert-deftest test-org/timestamp-to-time ()
"Test `org-timestamp-to-time' specifications."