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

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

[elpa] externals/pyim 320e8ab0f7 1/3: * tests/pyim-tests.el (pyim-tests-


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

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

    * tests/pyim-tests.el (pyim-tests-pyim-cstring-forward-or-backward-word): 
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 f3ce85c73b..67e612b8ef 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -561,6 +561,19 @@
       (should (equal (pyim-cstring-words-at-point)
                      '(("天安门" 3 0) ("安门" 2 0)))))))
 
+(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)) "哈哈"))))
+
 ;; ** pyim-cregexp 相关单元测试
 (ert-deftest pyim-tests-pyim-cregexp ()
   (let ((regexp (pyim-cregexp-build "nihao")))



reply via email to

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