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

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

[elpa] externals/pyim 4d584ee28a 2/4: * tests/pyim-tests.el (pyim-tests-


From: ELPA Syncer
Subject: [elpa] externals/pyim 4d584ee28a 2/4: * tests/pyim-tests.el (pyim-tests-noninteractive-init): New function.
Date: Sat, 25 Dec 2021 19:57:39 -0500 (EST)

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

    * tests/pyim-tests.el (pyim-tests-noninteractive-init): New function.
---
 tests/pyim-tests.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 6795847450..1a9652332e 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -38,16 +38,20 @@
 (defun pyim-tests-make-temp-file (&optional dir-flag)
   (make-temp-file "pyim-tests-temp-" dir-flag))
 
-(setq default-input-method "pyim")
-(setq pyim-dicts nil)
-(setq pyim-extra-dicts nil)
-;; 设置 pyim-dcache-directory, 防止用户个人词库不小心被覆盖掉。
-(setq pyim-dcache-directory (pyim-tests-make-temp-file t))
-;; 做测试的时候不保存词库,防止因为误操作导致个人词库损坏。
-(defalias 'pyim-kill-emacs-hook-function #'ignore)
-
-(pyim-basedict-enable)
-(pyim-dcache-init-variables)
+(defun pyim-tests-noninteractive-init ()
+  (setq default-input-method "pyim")
+  (setq pyim-dicts nil)
+  (setq pyim-extra-dicts nil)
+  ;; 设置 pyim-dcache-directory, 防止用户个人词库不小心被覆盖掉。
+  (setq pyim-dcache-directory (pyim-tests-make-temp-file t))
+  ;; 做测试的时候不保存词库,防止因为误操作导致个人词库损坏。
+  (defalias 'pyim-kill-emacs-hook-function #'ignore)
+
+  (pyim-basedict-enable)
+  (pyim-dcache-init-variables))
+
+(when noninteractive
+  (pyim-tests-noninteractive-init))
 
 ;; ** pyim-schemes 相关单元测试
 (ert-deftest pyim-tests-pyim-schemes ()



reply via email to

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