[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 721d0a9c56 211/244: More ocaml tests
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 721d0a9c56 211/244: More ocaml tests |
Date: |
Thu, 6 Jan 2022 02:59:02 -0500 (EST) |
branch: elpa/evil-matchit
commit 721d0a9c56289288e670558aeb4c2ae3e4e295c6
Author: Tomasz KoĆodziejski <tkolodziejski@gmail.com>
Commit: Tomasz KoĆodziejski <tkolodziejski@gmail.com>
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 47894a6cc0 151/244: Merge pull request #93 from AitBits/patch-2, (continued)
- [nongnu] elpa/evil-matchit 47894a6cc0 151/244: Merge pull request #93 from AitBits/patch-2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4c6b8f412f 159/244: Add autoload definitions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1c428e192b 149/244: ocaml use font-lock-doc-face for comment, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0845b2a0bf 178/244: Merge pull request #109 from neojski/add-double-semicolon, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 11aa990ecb 177/244: Merge pull request #110 from leungbk/elisp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 11d98debf8 187/244: Merge pull request #115 from dajva/jump_motion, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit bc31e7d594 199/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 6fd4c56855 198/244: clean code, more c unit test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 24dcd74a55 205/244: support terminal in Emacs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ede6382955 206/244: enhance verilog mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 721d0a9c56 211/244: More ocaml tests,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit fccad4255b 217/244: Merge pull request #128 from leungbk/byte-comp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 593c2d53a7 224/244: `evilmi-sdk-simple-jump': skip comments, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit f397504270 204/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2df3a62a8b 222/244: Add a regression test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d7ad7f712b 235/244: emacs 28 changed API define-obsolete-function-alias. It is EVIL code. Not my code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d1f59ad941 225/244: Merge pull request #131 from nbfalcon/bugfix/evilmi-sdk-simple-jump-whitespace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ccc2cc8a62 221/244: `evilmi-sdk-simple-jump': skip whitespace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8862d8ea15 079/244: support for statement in lua-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 79ec08d921 113/244: add more verilog keywords, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit e9f77f7d6a 115/244: user can use less optimized algorithm, ELPA Syncer, 2022/01/06