aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMark Oteiza2017-09-18 09:00:45 -0400
committerMark Oteiza2017-09-18 09:00:45 -0400
commit331d0e520ff5a3599cc9958108a6b6b8cb277ce3 (patch)
treecdb5a3789c3959eb66103b76e12e5446fce52eeb /test
parent466df76f7df06a03760545fe03d71bc0dc7fe98f (diff)
downloademacs-331d0e520ff5a3599cc9958108a6b6b8cb277ce3.tar.gz
emacs-331d0e520ff5a3599cc9958108a6b6b8cb277ce3.zip
Fix gensym
* lisp/subr.el (gensym): Actually implement the default prefix. * test/lisp/subr-tests.el (subr-tests--gensym): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/subr-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index ac9e2df603c..a68688eba7a 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -300,6 +300,12 @@ cf. Bug#25477."
300 (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default ""))) 300 (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default "")))
301 (should (string= default res))))) 301 (should (string= default res)))))
302 302
303(ert-deftest subr-tests--gensym ()
304 "Test `gensym' behavior."
305 (should (equal (symbol-name (let ((gensym-counter 0)) (gensym)))
306 "g0"))
307 (should (eq (string-to-char (symbol-name (gensym))) ?g))
308 (should (eq (string-to-char (symbol-name (gensym "X"))) ?X)))
303 309
304(provide 'subr-tests) 310(provide 'subr-tests)
305;;; subr-tests.el ends here 311;;; subr-tests.el ends here