branch: elpa/evil-matchit commit 96a1aba323206e7999e4d37cd560b92123adf251 Author: Tomasz KoĆodziejski <tkolodziej...@gmail.com> Commit: Chen Bin <chenbin...@gmail.com>
Add ocaml tests --- Makefile | 4 +++- tests/evil-matchit-tests.el | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44320d1bcd..55fa2760cc 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ deps: @if [ ! -f deps/evil-1.14.0/evil.el ]; then curl -L https://stable.melpa.org/packages/evil-1.14.0.tar | tar x -C deps/; fi; @if [ ! -f deps/lua-mode.el ]; then curl -L https://raw.githubusercontent.com/immerrr/lua-mode/master/lua-mode.el > deps/lua-mode.el; fi; @if [ ! -f deps/markdown-mode.el ]; then curl -L https://raw.githubusercontent.com/jrblevin/markdown-mode/master/markdown-mode.el > deps/markdown-mode.el; fi; + @if [ ! -f deps/tuareg-2.2.0/tuareg.el ]; then curl -L https://stable.melpa.org/packages/tuareg-2.2.0.tar | tar x -C deps/; fi + .PHONY: test test: deps clean - @$(EMACS) -batch -Q -L . -L deps/evil-1.14.0 -l deps/lua-mode.el -l deps/markdown-mode.el -l evil-matchit.el -l tests/evil-matchit-tests.el \ No newline at end of file + @$(EMACS) -batch -Q -L . -L deps/evil-1.14.0 -l deps/lua-mode.el -l deps/markdown-mode.el -L deps/tuareg-2.2.0 -l evil-matchit.el -l tests/evil-matchit-tests.el diff --git a/tests/evil-matchit-tests.el b/tests/evil-matchit-tests.el index 2a878be9d4..0e207e331b 100644 --- a/tests/evil-matchit-tests.el +++ b/tests/evil-matchit-tests.el @@ -433,5 +433,27 @@ (should (eq major-mode 'emacs-lisp-mode)))) +(ert-deftest evilmi-test-ocaml () + (with-temp-buffer + (require 'tuareg) + + (insert "if foo\n" + "then 1 else 2\n") + (tuareg-mode) + + (when (fboundp 'font-lock-ensure) + (font-lock-ensure) + + (goto-char (point-min)) + + (should (string= "if" (thing-at-point 'word))) + (evilmi-jump-items) + (should (string= "then" (thing-at-point 'word))) + ;; jump back + (evilmi-jump-items) + (should (string= "if" (thing-at-point 'word)))) + + (should (eq major-mode 'tuareg-mode)))) + (ert-run-tests-batch-and-exit) ;;; evil-matchit-tests.el ends here