aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-09-15 14:10:49 -0700
committerPaul Eggert2018-09-15 14:11:10 -0700
commit3937b5b52af3eb78101dc385ac8dfe7a36e2e624 (patch)
tree8cc092ce275f119e93508127764e1460d4a1bf94
parenta2d5cb5a6175de5ad338d7e3e59916b9a1af9f7c (diff)
downloademacs-3937b5b52af3eb78101dc385ac8dfe7a36e2e624.tar.gz
emacs-3937b5b52af3eb78101dc385ac8dfe7a36e2e624.zip
Fix icalendar tests to match new behavior
* test/lisp/calendar/icalendar-tests.el (icalendar--create-uid): Do not intrude into or rely upon undocumented internal implementation details of icalendar--create-uid. Problem reported by Glenn Morris in: https://lists.gnu.org/r/emacs-devel/2018-09/msg00660.html
-rw-r--r--test/lisp/calendar/icalendar-tests.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el
index 2fecabcd75b..617e8869897 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -57,17 +57,16 @@
57 57
58(ert-deftest icalendar--create-uid () 58(ert-deftest icalendar--create-uid ()
59 "Test for `icalendar--create-uid'." 59 "Test for `icalendar--create-uid'."
60 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s") 60 (let* ((icalendar-uid-format "xxx-%c-%h-%u-%s")
61 (icalendar--uid-count 77) 61 (icalendar--uid-count 77)
62 (entry-full "30.06.1964 07:01 blahblah") 62 (entry-full "30.06.1964 07:01 blahblah")
63 (hash (format "%d" (abs (sxhash entry-full)))) 63 (hash (format "%d" (abs (sxhash entry-full))))
64 (contents "DTSTART:19640630T070100\nblahblah") 64 (contents "DTSTART:19640630T070100\nblahblah")
65 (username (or user-login-name "UNKNOWN_USER"))) 65 (username (or user-login-name "UNKNOWN_USER")))
66 (cl-letf (((symbol-function 'current-time) (lambda () '(1 2 3)))) 66 (should (= 77 icalendar--uid-count))
67 (should (= 77 icalendar--uid-count)) 67 (should (string= (concat "xxx-77-" hash "-" username "-19640630")
68 (should (string= (concat "xxx-123-77-" hash "-" username "-19640630") 68 (icalendar--create-uid entry-full contents)))
69 (icalendar--create-uid entry-full contents))) 69 (should (= 78 icalendar--uid-count))
70 (should (= 78 icalendar--uid-count)))
71 (setq contents "blahblah") 70 (setq contents "blahblah")
72 (setq icalendar-uid-format "yyy%syyy") 71 (setq icalendar-uid-format "yyy%syyy")
73 (should (string= (concat "yyyDTSTARTyyy") 72 (should (string= (concat "yyyDTSTARTyyy")