summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/bookmark-tests.el30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/lisp/bookmark-tests.el b/test/lisp/bookmark-tests.el
index ae7331fcc2b..a2d8f2d260b 100644
--- a/test/lisp/bookmark-tests.el
+++ b/test/lisp/bookmark-tests.el
@@ -197,6 +197,9 @@ the lexically-bound variable `buffer'."
(bookmark-maybe-historicize-string "foo")
(should (equal (car bookmark-history) "foo"))))
+(defun bookmark-remove-last-modified (bmk)
+ (assoc-delete-all 'last-modified bmk))
+
(ert-deftest bookmark-tests-make-record ()
(with-bookmark-test-file
(let* ((record `("example.txt" (filename . ,bookmark-tests-example-file)
@@ -206,9 +209,11 @@ the lexically-bound variable `buffer'."
(defaults "example.txt"))))
(with-current-buffer buffer
(goto-char 3)
- (should (equal (bookmark-make-record) record))
+ (should (equal (bookmark-remove-last-modified (bookmark-make-record))
+ record))
;; calling twice gives same record
- (should (equal (bookmark-make-record) record))))))
+ (should (equal (bookmark-remove-last-modified (bookmark-make-record))
+ record))))))
(ert-deftest bookmark-tests-make-record-list ()
(with-bookmark-test-file-list
@@ -219,9 +224,11 @@ the lexically-bound variable `buffer'."
(defaults "example.txt"))))
(with-current-buffer buffer
(goto-char 3)
- (should (equal (bookmark-make-record) record))
+ (should (equal (bookmark-remove-last-modified (bookmark-make-record))
+ record))
;; calling twice gives same record
- (should (equal (bookmark-make-record) record))))))
+ (should (equal (bookmark-remove-last-modified (bookmark-make-record))
+ record))))))
(ert-deftest bookmark-tests-make-record-function ()
(with-bookmark-test
@@ -255,15 +262,18 @@ the lexically-bound variable `buffer'."
;; Set first bookmark
(goto-char (point-min))
(bookmark-set "foo")
- (should (equal bookmark-alist (list bmk1)))
+ (should (equal (mapcar #'bookmark-remove-last-modified bookmark-alist)
+ (list bmk1)))
;; Replace that bookmark
(goto-char (point-max))
(bookmark-set "foo")
- (should (equal bookmark-alist (list bmk2)))
+ (should (equal (mapcar #'bookmark-remove-last-modified bookmark-alist)
+ (list bmk2)))
;; Push another bookmark with the same name
(goto-char (point-min))
(bookmark-set "foo" t) ; NO-OVERWRITE is t
- (should (equal bookmark-alist (list bmk1 bmk2)))
+ (should (equal (mapcar #'bookmark-remove-last-modified bookmark-alist)
+ (list bmk1 bmk2)))
;; 2. bookmark-set-no-overwrite
;; Don't overwrite
@@ -271,11 +281,13 @@ the lexically-bound variable `buffer'."
;; Set new bookmark
(setq bookmark-alist nil)
(bookmark-set-no-overwrite "foo")
- (should (equal bookmark-alist (list bmk1)))
+ (should (equal (mapcar #'bookmark-remove-last-modified bookmark-alist)
+ (list bmk1)))
;; Push another bookmark with the same name
(goto-char (point-max))
(bookmark-set-no-overwrite "foo" t) ; PUSH-BOOKMARK is t
- (should (equal bookmark-alist (list bmk2 bmk1)))
+ (should (equal (mapcar #'bookmark-remove-last-modified bookmark-alist)
+ (list bmk2 bmk1)))
;; 3. bookmark-set-internal
(should-error (bookmark-set-internal "foo" "bar" t))))))