diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-12-19 13:42:21 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-12-19 13:42:47 -0800 |
commit | f4ea7464516b22409f429e98595b97cbf8220f4c (patch) | |
tree | 8b48a82e1d3c11ce7629e553df614ec453ec332a /test/lisp/emacs-lisp | |
parent | fda43a7bef499024fa5fcb32432e76c5839ee154 (diff) | |
download | emacs-f4ea7464516b22409f429e98595b97cbf8220f4c.tar.gz emacs-f4ea7464516b22409f429e98595b97cbf8220f4c.tar.bz2 emacs-f4ea7464516b22409f429e98595b97cbf8220f4c.zip |
cl-make-random-state was not copying its arg
Problem reported by Xu Chunyang (Bug#33731).
* lisp/emacs-lisp/cl-extra.el (cl-make-random-state):
Use copy-sequence, not copy-tree, so that the record is copied.
* test/lisp/emacs-lisp/cl-extra-tests.el:
(cl-extra-test-cl-make-random-state): New test.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/cl-extra-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index baad8eb8e67..fe59703530f 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -94,4 +94,9 @@ (should (equal (list lst3 (cdr lst3) (cddr lst3)) (cl-maplist fn3 lst lst2 lst3))))) +(ert-deftest cl-extra-test-cl-make-random-state () + (let ((s (cl-make-random-state))) + ;; Test for Bug#33731. + (should-not (eq s (cl-make-random-state s))))) + ;;; cl-extra-tests.el ends here |