diff options
| author | Mark Oteiza | 2017-09-18 09:00:45 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-18 09:00:45 -0400 |
| commit | 331d0e520ff5a3599cc9958108a6b6b8cb277ce3 (patch) | |
| tree | cdb5a3789c3959eb66103b76e12e5446fce52eeb /test | |
| parent | 466df76f7df06a03760545fe03d71bc0dc7fe98f (diff) | |
| download | emacs-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.el | 6 |
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 |