diff options
| author | Mattias EngdegÄrd | 2023-05-25 22:28:25 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-05-26 10:22:51 +0200 |
| commit | f535c0e49d5e629e60eabe9097b9c674783f9674 (patch) | |
| tree | 5f186e869a48b8652c97f3cdc25c99f4f4c0701f /test/src/lread-tests.el | |
| parent | c0d7447e9dc14cca9a71c8cd4a84573c22108662 (diff) | |
| download | emacs-f535c0e49d5e629e60eabe9097b9c674783f9674.tar.gz emacs-f535c0e49d5e629e60eabe9097b9c674783f9674.zip | |
Handle #@00 in new reader in a compatible way (bug#63722)
This was a regression from Emacs 28.
* src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which
is a quirk from the old reader that we preserve for compatibility.
* test/src/lread-tests.el (lread-skip-to-eof): Verify it.
Reported by Richard Newton.
Diffstat (limited to 'test/src/lread-tests.el')
| -rw-r--r-- | test/src/lread-tests.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 459a06a39b6..7d885abf364 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -339,4 +339,20 @@ literals (Bug#20852)." | |||
| 339 | (should (byte-code-function-p f)) | 339 | (should (byte-code-function-p f)) |
| 340 | (should (equal (aref f 4) "My little\ndoc string\nhere")))))) | 340 | (should (equal (aref f 4) "My little\ndoc string\nhere")))))) |
| 341 | 341 | ||
| 342 | (ert-deftest lread-skip-to-eof () | ||
| 343 | ;; Check the special #@00 syntax that, for compatibility, reads as | ||
| 344 | ;; nil while absorbing the remainder of the input. | ||
| 345 | (with-temp-buffer | ||
| 346 | (insert "#@00 and the rest\n" | ||
| 347 | "should be ignored) entirely\n") | ||
| 348 | (goto-char (point-min)) | ||
| 349 | (should (equal (read (current-buffer)) nil)) | ||
| 350 | (should (eobp)) | ||
| 351 | ;; Add an unbalanced bracket to the beginning and try again; | ||
| 352 | ;; we should get an error. | ||
| 353 | (goto-char (point-min)) | ||
| 354 | (insert "( ") | ||
| 355 | (goto-char (point-min)) | ||
| 356 | (should-error (read (current-buffer)) :type 'end-of-file))) | ||
| 357 | |||
| 342 | ;;; lread-tests.el ends here | 358 | ;;; lread-tests.el ends here |