diff options
| author | Stefan Kangas | 2020-12-30 08:29:38 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2020-12-30 08:32:36 +0100 |
| commit | 2d58e0e803fb5fe397d446d58a0d83f0d35b4fc4 (patch) | |
| tree | ad3b61f9acc71078976df3ad71b27084fbea6904 | |
| parent | b4fd857ead728a06380250c5336c1ab94a7c2f7a (diff) | |
| download | emacs-2d58e0e803fb5fe397d446d58a0d83f0d35b4fc4.tar.gz emacs-2d58e0e803fb5fe397d446d58a0d83f0d35b4fc4.zip | |
Add some char-table tests
* test/src/chartab-tests.el (chartab-test-char-table-p)
(chartab-test-char-table-subtype)
(chartab-test-char-table-parent)
(chartab-test-char-table-extra-slot): New tests.
| -rw-r--r-- | test/src/chartab-tests.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/src/chartab-tests.el b/test/src/chartab-tests.el index 4d52dc367c8..0a8d8bcdf7d 100644 --- a/test/src/chartab-tests.el +++ b/test/src/chartab-tests.el | |||
| @@ -49,5 +49,25 @@ | |||
| 49 | (#xe0e00 . #xe0ef6) | 49 | (#xe0e00 . #xe0ef6) |
| 50 | ))) | 50 | ))) |
| 51 | 51 | ||
| 52 | (ert-deftest chartab-test-char-table-p () | ||
| 53 | (should (char-table-p (make-char-table 'foo))) | ||
| 54 | (should (not (char-table-p (make-hash-table))))) | ||
| 55 | |||
| 56 | (ert-deftest chartab-test-char-table-subtype () | ||
| 57 | (should (eq (char-table-subtype (make-char-table 'foo)) 'foo))) | ||
| 58 | |||
| 59 | (ert-deftest chartab-test-char-table-parent () | ||
| 60 | (should (eq (char-table-parent (make-char-table 'foo)) nil)) | ||
| 61 | (let ((parent (make-char-table 'foo)) | ||
| 62 | (child (make-char-table 'bar))) | ||
| 63 | (set-char-table-parent child parent) | ||
| 64 | (should (eq (char-table-parent child) parent)))) | ||
| 65 | |||
| 66 | (ert-deftest chartab-test-char-table-extra-slot () | ||
| 67 | ;; Use any type with extra slots, e.g. 'case-table. | ||
| 68 | (let ((tbl (make-char-table 'case-table))) | ||
| 69 | (set-char-table-extra-slot tbl 1 'bar) | ||
| 70 | (char-table-extra-slot tbl 1))) | ||
| 71 | |||
| 52 | (provide 'chartab-tests) | 72 | (provide 'chartab-tests) |
| 53 | ;;; chartab-tests.el ends here | 73 | ;;; chartab-tests.el ends here |