branch: externals/pyim commit d273b67dcd7dfe51ff8674348ef9776f166d604e Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
* tests/pyim-tests.el (pyim-tests-pyim-entered): 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 1a9652332e..06c5ba03fe 100644 --- a/tests/pyim-tests.el +++ b/tests/pyim-tests.el @@ -301,6 +301,18 @@ (should (equal (pyim-punctuation-return-proper-punct '("'" "‘" "’")) "‘")) (should (equal (pyim-punctuation-return-proper-punct '("'" "‘" "’")) "’")))) +;; ** pyim-entered 相关单元测试 +(ert-deftest pyim-tests-pyim-entered () + (pyim-entered-with-entered-buffer + (erase-buffer) + (insert "nihao") + (backward-char 3)) + (should (equal (pyim-entered-get) "nihao")) + (should (equal (pyim-entered-get 'point-before) "ni")) + (should (equal (pyim-entered-get 'point-after) "hao")) + (pyim-entered-erase-buffer) + (should (equal (pyim-entered-get) ""))) + ;; ** pyim-impobjs 相关单元测试 (ert-deftest pyim-tests-pyim-imobjs () (let ((pyim-pinyin-fuzzy-alist '(("en" "eng")