[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 5c43939d01 212/244: Merge pull request #126 f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 5c43939d01 212/244: Merge pull request #126 from neojski/more-ocaml-tests |
Date: |
Thu, 6 Jan 2022 02:59:02 -0500 (EST) |
branch: elpa/evil-matchit
commit 5c43939d014bd312f23c940a6d2f3598d2a452c5
Merge: 96a1aba323 721d0a9c56
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #126 from neojski/more-ocaml-tests
More ocaml tests
---
tests/evil-matchit-tests.el | 74 +++++++++++++++++++++++++++++++++++++++------
1 file changed, 65 insertions(+), 9 deletions(-)
diff --git a/tests/evil-matchit-tests.el b/tests/evil-matchit-tests.el
index 0e207e331b..e91114d091 100644
--- a/tests/evil-matchit-tests.el
+++ b/tests/evil-matchit-tests.el
@@ -436,22 +436,78 @@
(ert-deftest evilmi-test-ocaml ()
(with-temp-buffer
(require 'tuareg)
-
- (insert "if foo\n"
- "then 1 else 2\n")
(tuareg-mode)
+ (defun prepare (&rest text)
+ (progn
+ (erase-buffer)
+ (apply 'insert text)
+ (goto-char (point-min))
+ (font-lock-ensure)))
+
+ (defun expect (text)
+ (progn
+ (insert "|")
+ (should (string= text (thing-at-point 'line)))
+ (delete-backward-char 1)))
+
(when (fboundp 'font-lock-ensure)
- (font-lock-ensure)
+ ;; if then
+ ;; TODO: doesn't work if there's no whitespace before if
+ (prepare " if foo then 1 else 2")
- (goto-char (point-min))
+ (evilmi-jump-items)
+ (expect " if foo |then 1 else 2")
- (should (string= "if" (thing-at-point 'word)))
(evilmi-jump-items)
- (should (string= "then" (thing-at-point 'word)))
- ;; jump back
+ (expect " |if foo then 1 else 2")
+
+ ;; parentheses
+ (prepare "let x = (1, 2) in 3")
+
+ (evilmi-jump-items)
+ (expect "let x = (1, 2|) in 3" )
+
+ (evilmi-jump-items)
+ (expect "let x = |(1, 2) in 3" )
+
+ ;; struct end
+ (prepare "module X = struct type t = int end")
+
+ (evilmi-jump-items)
+ (expect "module X = struct type t = int |end" )
+
+ (evilmi-jump-items)
+ (expect "module X = |struct type t = int end" )
+
+ ;; TODO: begin end doesn't seem to be working
+ (prepare "begin 1 end ;;")
+
+ (evilmi-jump-items)
+ (expect "|begin 1 end ;;")
+
+ ;; match with
+ (prepare "let _ = match x with _ -> ()")
+
+ (evilmi-jump-items)
+ (expect "let _ = match x |with _ -> ()" )
+
+ (evilmi-jump-items)
+ (expect "let _ = |match x with _ -> ()" )
+
+ ;; let in
+ (prepare
+ "let () =\n"
+ " let x = foo in bar")
+
+ (goto-char 10)
+ (expect "| let x = foo in bar" )
+
+ (evilmi-jump-items)
+ (expect " let x = foo |in bar" )
+
(evilmi-jump-items)
- (should (string= "if" (thing-at-point 'word))))
+ (expect " |let x = foo in bar" ))
(should (eq major-mode 'tuareg-mode))))
- [nongnu] elpa/evil-matchit dead63c7d0 194/244: add unit test, (continued)
- [nongnu] elpa/evil-matchit dead63c7d0 194/244: add unit test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 80dc731ab7 237/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0be04f960f 049/244: use text objects v1.3.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 62cef4f91a 077/244: replace evil-jump-items v2.0, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 6390e9e06c 216/244: Silence byte-compiler, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ae8fddea39 207/244: clean code, tdd for markdown, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0fd65c463b 226/244: clean code&doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ceec6a63b0 236/244: better algorithm to match bracket/brace in javascript, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8c4f516265 238/244: Support matlab-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 82c80786e5 240/244: jump between merge conflict markers, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 5c43939d01 212/244: Merge pull request #126 from neojski/more-ocaml-tests,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit cdb9b90381 229/244: extra json support, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d005e0465e 223/244: Merge pull request #130 from nbfalcon/bugfix/evilmi-sdk-simple-jump-whitespace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ce90eae4bd 243/244: typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit a0c5bd1fe8 230/244: support quote and export section in org file, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9cdaddd55d 228/244: Merge pull request #132 from aaronjensen/require-evil-macros, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8b71b42603 041/244: better support for sh and c/c++ v1.2.8, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4846518b59 109/244: support rjsx-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0b0e6d61a6 119/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8a10046f25 145/244: fix python issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0d62d497d1 143/244: Fix typo, ELPA Syncer, 2022/01/06