[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 2830b94 3/4: * tests/pyim-tests.el (pyim-tests-pyi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 2830b94 3/4: * tests/pyim-tests.el (pyim-tests-pyim-cstring-to-xingma): New test. |
Date: |
Tue, 14 Dec 2021 19:57:35 -0500 (EST) |
branch: externals/pyim
commit 2830b944185311ea586fbd7546fbf0d97df57b5b
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
* tests/pyim-tests.el (pyim-tests-pyim-cstring-to-xingma): 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 72b15a0..199cd72 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -486,6 +486,17 @@
"Hello -yin-hang-hen-xing- Hi Hello
-yin-hang-hen-heng- Hi "
"Hello -yin-hang-hen-hang- Hi")))))
+(ert-deftest pyim-tests-pyim-cstring-to-xingma ()
+ (let ((pyim-dhashcache-word2code (make-hash-table :test #'equal)))
+ (puthash "工" (list "wubi/aaaa" "cangjie/mlm" "gong")
pyim-dhashcache-word2code)
+ (puthash "房" (list "wubi/yny") pyim-dhashcache-word2code)
+ (puthash "丛" (list "wubi/wwg") pyim-dhashcache-word2code)
+ (should (equal (pyim-cstring-to-xingma "工" 'wubi) "aaaa"))
+ (should (equal (pyim-cstring-to-xingma "工房" 'wubi) "aayn"))
+ (should (equal (pyim-cstring-to-xingma "工房丛" 'wubi) "ayww"))
+ (should (equal (pyim-cstring-to-xingma "工房丛房" 'wubi) "aywy"))
+ (should (equal (pyim-cstring-to-xingma "工" 'wubi t) '("aaaa")))))
+
(ert-deftest pyim-tests-pyim-cstring-words-at-point ()
(let ((pyim-dhashcache-code2word (make-hash-table :test #'equal)))
(puthash "tian-an" (list "天安") pyim-dhashcache-code2word)