summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el15
-rw-r--r--test/src/lread-tests.el9
2 files changed, 24 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 84004a9264a..d15bd8b6e65 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -530,6 +530,21 @@ literals (Bug#20852)."
"`?\"', `?(', `?)', `?;', `?[', `?]' "
"detected!"))))))))
+(ert-deftest bytecomp-tests--old-style-backquotes ()
+ "Check that byte compiling warns about old-style backquotes."
+ (should (boundp 'lread--old-style-backquotes))
+ (bytecomp-tests--with-temp-file source
+ (write-region "(` (a b))" nil source)
+ (bytecomp-tests--with-temp-file destination
+ (let* ((byte-compile-dest-file-function (lambda (_) destination))
+ (byte-compile-error-on-warn t)
+ (byte-compile-debug t)
+ (err (should-error (byte-compile-file source))))
+ (should (equal (cdr err)
+ (list "!! The file uses old-style backquotes !!
+This functionality has been obsolete for more than 10 years already
+and will be removed soon. See (elisp)Backquote in the manual.")))))))
+
;; Local Variables:
;; no-byte-compile: t
;; End:
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index 685ea682e29..98cbb6a301d 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -155,4 +155,13 @@ literals (Bug#20852)."
(load "somelib" nil t)
(should (string-suffix-p "/somelib.el" (caar load-history)))))
+(ert-deftest lread-tests--old-style-backquotes ()
+ "Check that loading warns about old-style backquotes."
+ (lread-tests--with-temp-file file-name
+ (write-region "(` (a b))" nil file-name)
+ (should (equal (load file-name nil :nomessage :nosuffix) t))
+ (should (equal (lread-tests--last-message)
+ (concat (format-message "Loading `%s': " file-name)
+ "old-style backquotes detected!")))))
+
;;; lread-tests.el ends here