branch: externals/pyim commit 8932f2c7425aaeef68a16e974b87d7dc38aa8e31 Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
* tests/pyim-tests.el (pyim-tests-pyim-dhashcache-get-shortcode): New test. --- tests/pyim-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el index 2de6d67..18c0830 100644 --- a/tests/pyim-tests.el +++ b/tests/pyim-tests.el @@ -596,6 +596,17 @@ (should (equal (gethash "测嘊" pyim-dhashcache-iword2count) 34567)) (should (equal (gethash "测伌" pyim-dhashcache-iword2count) 0)))) +;; ** pyim-dhashcache 相关单元测试 +(ert-deftest pyim-tests-pyim-dhashcache-get-shortcode () + (should (equal (pyim-dhashcache-get-shortcode ".abcde") + '(".abcd" ".abc" ".ab"))) + (should (equal (pyim-dhashcache-get-shortcode "wubi/abcde") + '("wubi/abcd" "wubi/abc" "wubi/ab"))) + (should (equal (pyim-dhashcache-get-shortcode "abcde") + '("abcd" "abc" "ab"))) + (should (equal (pyim-dhashcache-get-shortcode "ni-hao") nil)) + (should (equal (pyim-dhashcache-get-shortcode "") nil))) + ;; ** pyim-dregcache 相关单元测试 (ert-deftest pyim-tests-pyim-general () (let ((pyim-dcache-backend 'pyim-dregcache))