1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00

Add test for add-to-ordered-list

This commit is contained in:
Lars Ingebrigtsen 2020-12-31 05:00:45 +01:00
parent aba77849cd
commit 3d9f20cfcf

View File

@ -597,6 +597,22 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
(undo-boundary)
(undo)
(should (equal (buffer-string) ""))))
(defvar subr--ordered nil)
(ert-deftest subr--add-to-ordered-list ()
(setq subr--ordered nil)
(add-to-ordered-list 'subr--ordered 'b 2)
(should (equal subr--ordered '(b)))
(add-to-ordered-list 'subr--ordered 'c 3)
(should (equal subr--ordered '(b c)))
(add-to-ordered-list 'subr--ordered 'a 1)
(should (equal subr--ordered '(a b c)))
(add-to-ordered-list 'subr--ordered 'e)
(should (equal subr--ordered '(a b c e)))
(add-to-ordered-list 'subr--ordered 'd 4)
(should (equal subr--ordered '(a b c d e))))
;;; Apropos.