diff options
| author | Eric S. Raymond | 2026-02-25 17:23:46 -0500 |
|---|---|---|
| committer | Eric S. Raymond | 2026-02-25 17:23:46 -0500 |
| commit | 7a93a7b3345f7ae4e8f487b562b19a4b5fed8496 (patch) | |
| tree | 84b6365646c8a0969dcbbdf85ba1851b2fd003d6 /test/src/coding-tests.el | |
| parent | fc7339c46dc87d5d7051f976206bb5c4d9efdfb8 (diff) | |
| download | emacs-7a93a7b3345f7ae4e8f487b562b19a4b5fed8496.tar.gz emacs-7a93a7b3345f7ae4e8f487b562b19a4b5fed8496.zip | |
Category/charset/coding + char-table tests.
Diffstat (limited to 'test/src/coding-tests.el')
| -rw-r--r-- | test/src/coding-tests.el | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index dc1abec2d58..4529002ad3b 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el | |||
| @@ -421,6 +421,48 @@ | |||
| 421 | (should-not (eq (encode-coding-string s coding nil) s)) | 421 | (should-not (eq (encode-coding-string s coding nil) s)) |
| 422 | (should (eq (encode-coding-string s coding t) s)))))) | 422 | (should (eq (encode-coding-string s coding t) s)))))) |
| 423 | 423 | ||
| 424 | (ert-deftest coding-tests-coding-system-p () | ||
| 425 | (should (coding-system-p nil)) | ||
| 426 | (should (coding-system-p 'utf-8)) | ||
| 427 | (should-not (coding-system-p 'coding-tests-no-such-system))) | ||
| 428 | |||
| 429 | (ert-deftest coding-tests-check-coding-system () | ||
| 430 | (should (eq (check-coding-system 'utf-8) 'utf-8)) | ||
| 431 | (should (eq (check-coding-system nil) nil)) | ||
| 432 | (should-error (check-coding-system 'coding-tests-no-such-system) | ||
| 433 | :type 'coding-system-error)) | ||
| 434 | |||
| 435 | (ert-deftest coding-tests-coding-system-priority-list () | ||
| 436 | (let ((list (coding-system-priority-list))) | ||
| 437 | (should (listp list)) | ||
| 438 | (should (consp list)) | ||
| 439 | (dolist (cs list) | ||
| 440 | (should (coding-system-p cs)))) | ||
| 441 | (let ((highest (coding-system-priority-list t))) | ||
| 442 | (should (symbolp highest)) | ||
| 443 | (should (coding-system-p highest)))) | ||
| 444 | |||
| 445 | (ert-deftest coding-tests-coding-system-aliases () | ||
| 446 | (let ((aliases (coding-system-aliases 'utf-8))) | ||
| 447 | (should (listp aliases)) | ||
| 448 | (should (memq 'utf-8 aliases)))) | ||
| 449 | |||
| 450 | (ert-deftest coding-tests-coding-system-plist () | ||
| 451 | (let ((plist (coding-system-plist 'utf-8))) | ||
| 452 | (should (listp plist)) | ||
| 453 | (should (plist-member plist :mnemonic)))) | ||
| 454 | |||
| 455 | (ert-deftest coding-tests-coding-system-put () | ||
| 456 | (let* ((cs 'utf-8) | ||
| 457 | (mnemonic (plist-get (coding-system-plist cs) :mnemonic))) | ||
| 458 | (coding-system-put cs :mnemonic mnemonic) | ||
| 459 | (should (eq (plist-get (coding-system-plist cs) :mnemonic) mnemonic)))) | ||
| 460 | |||
| 461 | (ert-deftest coding-tests-coding-system-eol-type () | ||
| 462 | (let ((eol (coding-system-eol-type 'utf-8-unix))) | ||
| 463 | (should (integerp eol)) | ||
| 464 | (should (memq eol '(0 1 2))))) | ||
| 465 | |||
| 424 | 466 | ||
| 425 | (ert-deftest coding-check-coding-systems-region () | 467 | (ert-deftest coding-check-coding-systems-region () |
| 426 | (should (equal (check-coding-systems-region "aå" nil '(utf-8)) | 468 | (should (equal (check-coding-systems-region "aå" nil '(utf-8)) |