summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/rx-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-06-26 08:47:56 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-06-26 08:50:27 -0400
commit9233865b7005831e63755eb84ae7da060f878a55 (patch)
treecf63da70311c6e2fef3e51f575776eca8173a0de /test/lisp/emacs-lisp/rx-tests.el
parent260b6c2c931d74ef64dacb20b7fcae6f888e6d42 (diff)
downloademacs-9233865b7005831e63755eb84ae7da060f878a55.tar.gz
emacs-9233865b7005831e63755eb84ae7da060f878a55.tar.bz2
emacs-9233865b7005831e63755eb84ae7da060f878a55.zip
Fix (rx-to-string (and (literal STR) (regexp STR)) regression
* lisp/emacs-lisp/rx.el (rx-regexp, rx-literal): Check the cadr of the form for stringness, not the form itself. * test/lisp/emacs-lisp/rx-tests.el (rx-to-string-lisp-forms): New test.
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index bab71b522bb..8845ebf46d1 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -156,5 +156,9 @@
(rx-tests--match (rx "c" (minimal-match (0+ (regexp ad))) "a") "cdaaada" "cda")
(rx-tests--match (rx "c" (maximal-match (0+ (regexp ad))) "a") "cdaaada" "cdaaada")))
+(ert-deftest rx-to-string-lisp-forms ()
+ (rx-tests--match (rx-to-string '(seq "a" (literal "b") "c")) "abc")
+ (rx-tests--match (rx-to-string '(seq "a" (regexp "b") "c")) "abc"))
+
(provide 'rx-tests)
;; rx-tests.el ends here.