emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pyim a0357cee82 3/3: * tests/pyim-tests.el (pyim-tests-


From: ELPA Syncer
Subject: [elpa] externals/pyim a0357cee82 3/3: * tests/pyim-tests.el (pyim-tests-pyim-cstring-forward-or-backward-word): Updated.
Date: Thu, 26 May 2022 09:57:52 -0400 (EDT)

branch: externals/pyim
commit a0357cee82006d76d5214cec2b045a2c041d4d7d
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    * tests/pyim-tests.el (pyim-tests-pyim-cstring-forward-or-backward-word): 
Updated.
---
 tests/pyim-tests.el | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 1e566c5e90..d45a8f08aa 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -567,16 +567,21 @@
 
 (ert-deftest pyim-tests-pyim-cstring-forward-or-backward-word ()
   (with-temp-buffer
-    (insert "哈哈我爱北京天安门天安门上太阳升")
-    (goto-char 2)
-    (pyim-cstring-forward-word 1)
-    (should (equal (buffer-substring (point-min) (point)) "哈哈"))
-    (pyim-cstring-forward-word 3)
-    (should (equal (buffer-substring (point-min) (point)) "哈哈我爱北京天安门"))
-    (pyim-cstring-backward-word 1)
-    (should (equal (buffer-substring (point-min) (point)) "哈哈我爱北京"))
-    (pyim-cstring-backward-word 2)
-    (should (equal (buffer-substring (point-min) (point)) "哈哈"))))
+    (let ((pyim-dhashcache-code2word (make-hash-table :test #'equal)))
+      (puthash "ha-ha" (list "哈哈") pyim-dhashcache-code2word)
+      (puthash "wo-ai" (list "我爱") pyim-dhashcache-code2word)
+      (puthash "bei-jing" (list "北京") pyim-dhashcache-code2word)
+      (puthash "tian-an-men" (list "天安门") pyim-dhashcache-code2word)
+      (insert "哈哈我爱北京天安门")
+      (goto-char 2)
+      (pyim-cstring-forward-word 1)
+      (should (equal (buffer-substring (point-min) (point)) "哈哈"))
+      (pyim-cstring-forward-word 3)
+      (should (equal (buffer-substring (point-min) (point)) "哈哈我爱北京天安门"))
+      (pyim-cstring-backward-word 1)
+      (should (equal (buffer-substring (point-min) (point)) "哈哈我爱北京"))
+      (pyim-cstring-backward-word 2)
+      (should (equal (buffer-substring (point-min) (point)) "哈哈")))))
 
 ;; ** pyim-cregexp 相关单元测试
 (ert-deftest pyim-tests-pyim-cregexp ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]