branch: externals/pyim commit 259625b30f14376747b9cc9dd9f4b64a276306a7 Merge: 3c13e24 a680cf6 Author: tumashu <tuma...@163.com> Commit: GitHub <nore...@github.com>
Merge pull request #403 from tumashu/redguardtoo fixed unit test --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ .travis.yml | 16 ---------------- README.org | 1 + tests/pyim-tests.el | 10 +++++++++- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a3dbc99 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + emacs_version: + - 25.3 + - 26.3 + - 27.1 + steps: + - uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + + - uses: actions/checkout@v2 + + - name: Print emacs version + run: emacs --version + + - name: Run tests + run: make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 100935e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: nix - -os: - - linux - -env: - - EMACS_CI=emacs-25-3 - - EMACS_CI=emacs-26-3 - - EMACS_CI=emacs-27-1 - - EMACS_CI=emacs-snapshot - -install: - - bash <(curl https://raw.githubusercontent.com/purcell/nix-emacs-ci/master/travis-install) - -script: - - bash <(make test) diff --git a/README.org b/README.org index 1badb38..84f2e67 100644 --- a/README.org +++ b/README.org @@ -2,6 +2,7 @@ #+TITLE: PYIM 是一个 Emacs 中文输入法,支持全拼,双拼,五笔,仓颉 和 Rime 等 #+AUTHOR: Feng Shu +#+html: <a href="https://github.com/tumashu/pyim/actions/workflows/test.yml"><img alt="Github Action" src="https://github.com/tumashu/pyim/workflows/test.yml/badge.svg"/></a> #+html: <a href="http://elpa.gnu.org/packages/pyim.html"><img alt="GNU ELPA" src="https://elpa.gnu.org/packages/pyim.svg"/></a> #+html: <a href="http://elpa.gnu.org/devel/pyim.html"><img alt="GNU-devel ELPA" src="https://elpa.gnu.org/devel/pyim.svg"/></a> #+html: <a href="https://melpa.org/#/pyim"><img alt="MELPA" src="https://melpa.org/packages/pyim-badge.svg"/></a> diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el index bc970fd..2d663be 100644 --- a/tests/pyim-tests.el +++ b/tests/pyim-tests.el @@ -43,6 +43,12 @@ (setq default-input-method "pyim") (setq pyim-dicts (pyim-test-get-dicts)) +(ert-deftest pyim-test-generic () + (let* ((pyim-dcache-backend 'pyim-dregcache)) + (with-temp-buffer + (should (not toggle-input-method-active)) + (call-interactively #'toggle-input-method)))) + (ert-deftest pyim-test-dregcache-backend () (let* ((pyim-dcache-backend 'pyim-dregcache) words) @@ -56,9 +62,11 @@ (setq words (pyim-dcache-get "zun-bei")) (should (eq (length words) 1)) (should (string= (nth 0 words) "尊卑")) + (setq words (pyim-dcache-get "zun")) (should (string= (nth 0 words) "尊")) - (should (eq (length words) 43)))) + ;; `pyim-dregcache-get' calls `pyim-pymap-py2cchar-get' before return result + (should (eq (length words) 44)))) (ert-run-tests-batch-and-exit) ;; * Footer