aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/lisp/calendar/icalendar-tests.el20
-rw-r--r--test/lisp/vc/vc-bzr-tests.el9
2 files changed, 10 insertions, 19 deletions
diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el
index 2c13a363213..20d88349bbc 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -32,6 +32,7 @@
32;;; Code: 32;;; Code:
33 33
34(require 'ert) 34(require 'ert)
35(require 'ert-x)
35(require 'icalendar) 36(require 'icalendar)
36 37
37;; ====================================================================== 38;; ======================================================================
@@ -58,23 +59,16 @@
58(ert-deftest icalendar--create-uid () 59(ert-deftest icalendar--create-uid ()
59 "Test for `icalendar--create-uid'." 60 "Test for `icalendar--create-uid'."
60 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s") 61 (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s")
61 t-ct
62 (icalendar--uid-count 77) 62 (icalendar--uid-count 77)
63 (entry-full "30.06.1964 07:01 blahblah") 63 (entry-full "30.06.1964 07:01 blahblah")
64 (hash (format "%d" (abs (sxhash entry-full)))) 64 (hash (format "%d" (abs (sxhash entry-full))))
65 (contents "DTSTART:19640630T070100\nblahblah") 65 (contents "DTSTART:19640630T070100\nblahblah")
66 (username (or user-login-name "UNKNOWN_USER")) 66 (username (or user-login-name "UNKNOWN_USER")))
67 ) 67 (ert-with-function-mocked current-time (lambda () '(1 2 3))
68 (fset 't-ct (symbol-function 'current-time)) 68 (should (= 77 icalendar--uid-count))
69 (unwind-protect 69 (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
70 (progn 70 (icalendar--create-uid entry-full contents)))
71 (fset 'current-time (lambda () '(1 2 3))) 71 (should (= 78 icalendar--uid-count)))
72 (should (= 77 icalendar--uid-count))
73 (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
74 (icalendar--create-uid entry-full contents)))
75 (should (= 78 icalendar--uid-count)))
76 ;; restore 'current-time
77 (fset 'current-time (symbol-function 't-ct)))
78 (setq contents "blahblah") 72 (setq contents "blahblah")
79 (setq icalendar-uid-format "yyy%syyy") 73 (setq icalendar-uid-format "yyy%syyy")
80 (should (string= (concat "yyyDTSTARTyyy") 74 (should (string= (concat "yyyDTSTARTyyy")
diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el
index 82721eeee4e..98d176ca1ee 100644
--- a/test/lisp/vc/vc-bzr-tests.el
+++ b/test/lisp/vc/vc-bzr-tests.el
@@ -25,6 +25,7 @@
25;;; Code: 25;;; Code:
26 26
27(require 'ert) 27(require 'ert)
28(require 'ert-x)
28(require 'vc-bzr) 29(require 'vc-bzr)
29(require 'vc-dir) 30(require 'vc-dir)
30 31
@@ -101,12 +102,8 @@
101 (while (vc-dir-busy) 102 (while (vc-dir-busy)
102 (sit-for 0.1)) 103 (sit-for 0.1))
103 (vc-dir-mark-all-files t) 104 (vc-dir-mark-all-files t)
104 (let ((f (symbol-function 'y-or-n-p))) 105 (ert-with-function-mocked y-or-n-p (lambda (_) t)
105 (unwind-protect 106 (vc-next-action nil))
106 (progn
107 (fset 'y-or-n-p (lambda (prompt) t))
108 (vc-next-action nil))
109 (fset 'y-or-n-p f)))
110 (should (get-buffer "*vc-log*"))) 107 (should (get-buffer "*vc-log*")))
111 (delete-directory homedir t)))) 108 (delete-directory homedir t))))
112 109