branch: externals/pyim commit 05e24f38d572188f66d09c4b43d618bc6f4407ec Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@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 你好")