diff options
| author | Philipp | 2017-05-06 22:23:03 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-05-13 12:32:29 +0200 |
| commit | a1d461592172ca4c8aac0e4e923ef5e909cfb361 (patch) | |
| tree | 7d972dbecad74eab4f7dfb37969ab0170c2870e1 /test | |
| parent | 16004397f40d15d9db6b90632c236c804f38fc40 (diff) | |
| download | emacs-a1d461592172ca4c8aac0e4e923ef5e909cfb361.tar.gz emacs-a1d461592172ca4c8aac0e4e923ef5e909cfb361.zip | |
Make `old-style-backquotes' variable internal
* src/lread.c (load_warn_old_style_backquotes, Fload, read1)
(syms_of_lread): Rename `old-style-backquotes' to
`lread--old-style-backquotes', and clarify that it's for internal
use only.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
variable.
* test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
unit test.
* emacs-lisp/bytecomp-tests.el
(bytecomp-tests--old-style-backquotes): Add unit test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 15 | ||||
| -rw-r--r-- | test/src/lread-tests.el | 9 |
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)." | |||
| 530 | "`?\"', `?(', `?)', `?;', `?[', `?]' " | 530 | "`?\"', `?(', `?)', `?;', `?[', `?]' " |
| 531 | "detected!")))))))) | 531 | "detected!")))))))) |
| 532 | 532 | ||
| 533 | (ert-deftest bytecomp-tests--old-style-backquotes () | ||
| 534 | "Check that byte compiling warns about old-style backquotes." | ||
| 535 | (should (boundp 'lread--old-style-backquotes)) | ||
| 536 | (bytecomp-tests--with-temp-file source | ||
| 537 | (write-region "(` (a b))" nil source) | ||
| 538 | (bytecomp-tests--with-temp-file destination | ||
| 539 | (let* ((byte-compile-dest-file-function (lambda (_) destination)) | ||
| 540 | (byte-compile-error-on-warn t) | ||
| 541 | (byte-compile-debug t) | ||
| 542 | (err (should-error (byte-compile-file source)))) | ||
| 543 | (should (equal (cdr err) | ||
| 544 | (list "!! The file uses old-style backquotes !! | ||
| 545 | This functionality has been obsolete for more than 10 years already | ||
| 546 | and will be removed soon. See (elisp)Backquote in the manual."))))))) | ||
| 547 | |||
| 533 | ;; Local Variables: | 548 | ;; Local Variables: |
| 534 | ;; no-byte-compile: t | 549 | ;; no-byte-compile: t |
| 535 | ;; End: | 550 | ;; 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)." | |||
| 155 | (load "somelib" nil t) | 155 | (load "somelib" nil t) |
| 156 | (should (string-suffix-p "/somelib.el" (caar load-history))))) | 156 | (should (string-suffix-p "/somelib.el" (caar load-history))))) |
| 157 | 157 | ||
| 158 | (ert-deftest lread-tests--old-style-backquotes () | ||
| 159 | "Check that loading warns about old-style backquotes." | ||
| 160 | (lread-tests--with-temp-file file-name | ||
| 161 | (write-region "(` (a b))" nil file-name) | ||
| 162 | (should (equal (load file-name nil :nomessage :nosuffix) t)) | ||
| 163 | (should (equal (lread-tests--last-message) | ||
| 164 | (concat (format-message "Loading `%s': " file-name) | ||
| 165 | "old-style backquotes detected!"))))) | ||
| 166 | |||
| 158 | ;;; lread-tests.el ends here | 167 | ;;; lread-tests.el ends here |