diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index f45c9209c14..83162d250fc 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -559,19 +559,25 @@ bytecompiled code, and their results compared.") | |||
| 559 | "Check that byte compiling warns about unescaped character | 559 | "Check that byte compiling warns about unescaped character |
| 560 | literals (Bug#20852)." | 560 | literals (Bug#20852)." |
| 561 | (should (boundp 'lread--unescaped-character-literals)) | 561 | (should (boundp 'lread--unescaped-character-literals)) |
| 562 | (bytecomp-tests--with-temp-file source | 562 | (let ((byte-compile-error-on-warn t) |
| 563 | (write-region "(list ?) ?( ?; ?\" ?[ ?])" nil source) | 563 | (byte-compile-debug t)) |
| 564 | (bytecomp-tests--with-temp-file destination | 564 | (bytecomp-tests--with-temp-file source |
| 565 | (let* ((byte-compile-dest-file-function (lambda (_) destination)) | 565 | (write-region "(list ?) ?( ?; ?\" ?[ ?])" nil source) |
| 566 | (byte-compile-error-on-warn t) | 566 | (bytecomp-tests--with-temp-file destination |
| 567 | (byte-compile-debug t) | 567 | (let* ((byte-compile-dest-file-function (lambda (_) destination)) |
| 568 | (err (should-error (byte-compile-file source)))) | 568 | (err (should-error (byte-compile-file source)))) |
| 569 | (should (equal (cdr err) | 569 | (should (equal (cdr err) |
| 570 | (list (concat "unescaped character literals " | 570 | `(,(concat "unescaped character literals " |
| 571 | "`?\"', `?(', `?)', `?;', `?[', `?]' " | 571 | "`?\"', `?(', `?)', `?;', `?[', `?]' " |
| 572 | "detected, " | 572 | "detected, " |
| 573 | "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', " | 573 | "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', " |
| 574 | "`?\\]' expected!")))))))) | 574 | "`?\\]' expected!"))))))) |
| 575 | ;; But don't warn in subsequent compilations (Bug#36068). | ||
| 576 | (bytecomp-tests--with-temp-file source | ||
| 577 | (write-region "(list 1 2 3)" nil source) | ||
| 578 | (bytecomp-tests--with-temp-file destination | ||
| 579 | (let ((byte-compile-dest-file-function (lambda (_) destination))) | ||
| 580 | (should (byte-compile-file source))))))) | ||
| 575 | 581 | ||
| 576 | (ert-deftest bytecomp-tests--old-style-backquotes () | 582 | (ert-deftest bytecomp-tests--old-style-backquotes () |
| 577 | "Check that byte compiling warns about old-style backquotes." | 583 | "Check that byte compiling warns about old-style backquotes." |