[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 8932f2c 1/5: * tests/pyim-tests.el (pyim-tests-pyi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 8932f2c 1/5: * tests/pyim-tests.el (pyim-tests-pyim-dhashcache-get-shortcode): New test. |
Date: |
Sun, 12 Dec 2021 22:57:39 -0500 (EST) |
branch: externals/pyim
commit 8932f2c7425aaeef68a16e974b87d7dc38aa8e31
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@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))