branch: externals/pyim commit d3f71f6324e153f05524ec54f4e0809dcb92f68b Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
* tests/pyim-tests.el (pyim-tests-pyim-dhashcache-export): New test. --- tests/pyim-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el index c91073a..d042dd4 100644 --- a/tests/pyim-tests.el +++ b/tests/pyim-tests.el @@ -718,6 +718,19 @@ zuo-zuo-you-mang 作作有芒") (pyim-dhashcache-update-iword2count "你好" nil (lambda (x) (* x 2))) (should (equal (gethash "你好" pyim-dhashcache-iword2count) 20)))) +(ert-deftest pyim-tests-pyim-dhashcache-export () + (let ((file (make-temp-file "pyim-dcache-")) + (icode2word (make-hash-table :test #'equal))) + (puthash "yin-xing" + (list (propertize "银行" :noexport t) + "因行") icode2word) + (pyim-dhashcache-export icode2word file) + (with-temp-buffer + (insert-file-contents file) + (should (equal(buffer-string) ";;; -*- coding: utf-8-unix -*- +yin-xing 因行 +"))))) + ;; ** pyim-dregcache 相关单元测试 (ert-deftest pyim-tests-pyim-general () (let ((pyim-dcache-backend 'pyim-dregcache))