diff options
| author | Mattias Engdegård | 2020-04-08 17:13:39 +0200 |
|---|---|---|
| committer | Mattias Engdegård | 2020-04-09 12:06:39 +0200 |
| commit | 786887cf439450ce7d8d6fbe624e8c434e50d469 (patch) | |
| tree | e097dce7c9f47bbc69dc0025076623ac4c014f14 /test/src/coding-tests.el | |
| parent | 402cbc5be26827244075dbe14288e7722290f83a (diff) | |
| download | emacs-786887cf439450ce7d8d6fbe624e8c434e50d469.tar.gz emacs-786887cf439450ce7d8d6fbe624e8c434e50d469.zip | |
Don't crash with invalid argument in check-coding-systems-region
* src/coding.c (Fcheck_coding_systems_region): Don't crash if
the third arg contains something that isn't a coding system.
* test/src/coding-tests.el (coding-check-coding-systems-region):
New test.
Diffstat (limited to 'test/src/coding-tests.el')
| -rw-r--r-- | test/src/coding-tests.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 83a06b8179e..8d92bcdcd1a 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el | |||
| @@ -411,6 +411,14 @@ | |||
| 411 | (should (eq (decode-coding-string s coding t) s)) | 411 | (should (eq (decode-coding-string s coding t) s)) |
| 412 | (should (eq (encode-coding-string s coding t) s)))))) | 412 | (should (eq (encode-coding-string s coding t) s)))))) |
| 413 | 413 | ||
| 414 | (ert-deftest coding-check-coding-systems-region () | ||
| 415 | (should (equal (check-coding-systems-region "aå" nil '(utf-8)) | ||
| 416 | nil)) | ||
| 417 | (should (equal (check-coding-systems-region "aåbγc" nil | ||
| 418 | '(utf-8 iso-latin-1 us-ascii)) | ||
| 419 | '((iso-latin-1 3) (us-ascii 1 3)))) | ||
| 420 | (should-error (check-coding-systems-region "å" nil '(bad-coding-system)))) | ||
| 421 | |||
| 414 | ;; Local Variables: | 422 | ;; Local Variables: |
| 415 | ;; byte-compile-warnings: (not obsolete) | 423 | ;; byte-compile-warnings: (not obsolete) |
| 416 | ;; End: | 424 | ;; End: |