aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani2018-06-02 11:59:02 +0200
committerPhilipp Stephani2019-04-19 19:19:35 +0200
commit0b4b380ce4989afc59848d2b6a350bd1dd7dc7ca (patch)
treed48cd46b86ff19c609dd16f7ef799dd720014ef3 /test
parent8aadf6e415b7801cb9fa4c5670b1750da207cf87 (diff)
downloademacs-0b4b380ce4989afc59848d2b6a350bd1dd7dc7ca.tar.gz
emacs-0b4b380ce4989afc59848d2b6a350bd1dd7dc7ca.zip
Make warning about unescaped character literals more helpful.
See Bug#31676. * lisp/emacs-lisp/byte-run.el (byte-run--unescaped-character-literals-warning): New defun. * src/lread.c (load_warn_unescaped_character_literals): Use new defun. (syms_of_lread): Define symbol for new defun. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use new defun. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el4
-rw-r--r--test/src/lread-tests.el4
2 files changed, 6 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index f66a06bc1bc..5fb64ff2881 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -540,7 +540,9 @@ literals (Bug#20852)."
540 (should (equal (cdr err) 540 (should (equal (cdr err)
541 (list (concat "unescaped character literals " 541 (list (concat "unescaped character literals "
542 "`?\"', `?(', `?)', `?;', `?[', `?]' " 542 "`?\"', `?(', `?)', `?;', `?[', `?]' "
543 "detected!")))))))) 543 "detected, "
544 "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', "
545 "`?\\]' expected!"))))))))
544 546
545(ert-deftest bytecomp-tests--old-style-backquotes () 547(ert-deftest bytecomp-tests--old-style-backquotes ()
546 "Check that byte compiling warns about old-style backquotes." 548 "Check that byte compiling warns about old-style backquotes."
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index ae918f03120..82b75b195ca 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -140,7 +140,9 @@ literals (Bug#20852)."
140 (should (equal (lread-tests--last-message) 140 (should (equal (lread-tests--last-message)
141 (concat (format-message "Loading `%s': " file-name) 141 (concat (format-message "Loading `%s': " file-name)
142 "unescaped character literals " 142 "unescaped character literals "
143 "`?\"', `?(', `?)', `?;', `?[', `?]' detected!"))))) 143 "`?\"', `?(', `?)', `?;', `?[', `?]' detected, "
144 "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', `?\\]' "
145 "expected!")))))
144 146
145(ert-deftest lread-tests--funny-quote-symbols () 147(ert-deftest lread-tests--funny-quote-symbols ()
146 "Check that 'smart quotes' or similar trigger errors in symbol names." 148 "Check that 'smart quotes' or similar trigger errors in symbol names."