[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 05e24f3 3/5: * tests/pyim-tests.el (pyim-tests-pyi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 05e24f3 3/5: * tests/pyim-tests.el (pyim-tests-pyim-char-before/after-to-string): New test. |
Date: |
Fri, 10 Dec 2021 21:57:41 -0500 (EST) |
branch: externals/pyim
commit 05e24f38d572188f66d09c4b43d618bc6f4407ec
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
* tests/pyim-tests.el (pyim-tests-pyim-char-before/after-to-string): New
test.
---
tests/pyim-tests.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 58aae18..183e82f 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -70,6 +70,18 @@
(should (equal (pyim-scheme-get-option 'wubi :class) 'xingma)))
;; ** pyim-common 相关单元测试
+(ert-deftest pyim-tests-pyim-char-before/after-to-string ()
+ (with-temp-buffer
+ (insert "你好世界abc")
+ (print (pyim-char-before-to-string 0))
+ (should (equal (pyim-char-before-to-string 0) "c"))
+ (should (equal (pyim-char-before-to-string 1) "b"))
+ (backward-char 5)
+ (should (equal (pyim-char-before-to-string 0) "好"))
+ (should (equal (pyim-char-before-to-string 1) "你"))
+ (should (equal (pyim-char-after-to-string 0) "世"))
+ (should (equal (pyim-char-after-to-string 1) "界"))))
+
(ert-deftest pyim-tests-pyim-dline-parse ()
(with-temp-buffer
(insert "ni-hao 你好")