[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit d75d41d7b3 197/244: add unit test for c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit d75d41d7b3 197/244: add unit test for c |
Date: |
Thu, 6 Jan 2022 02:59:01 -0500 (EST) |
branch: elpa/evil-matchit
commit d75d41d7b33ff12025af637a8272e30c0226489e
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
add unit test for c
---
tests/evil-matchit-tests.el | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/tests/evil-matchit-tests.el b/tests/evil-matchit-tests.el
index f7d9a9a01a..277f4df229 100644
--- a/tests/evil-matchit-tests.el
+++ b/tests/evil-matchit-tests.el
@@ -128,5 +128,37 @@
(should (string= (thing-at-point 'symbol) "/p"))
(should (eq major-mode 'html-mode)))))
+
+(ert-deftest evilmi-test-c ()
+ (let* ((str "#ifdef CONFIG_COMPAT\n#ifndef TEST1\nstruct mtip_s {\n int
v1;\n}\n#endif\n#endif\nstatic int fn1()\n{\nprintf(\"hello world\");\n}\nint a
= 3;"))
+ (with-temp-buffer
+ (insert str)
+ (c-mode)
+
+ ;; jump from start
+ (goto-char (point-min))
+ ;; test #ifdef
+ (evilmi-jump-items)
+ (should (string= "endif" (thing-at-point 'symbol)))
+ ;; test #ifndef
+ (forward-line -1)
+ (evilmi-jump-items)
+ (should (eq (point) (line-beginning-position)))
+ (should (eq (following-char) ?#))
+ (forward-char)
+ (should (string= "ifndef" (thing-at-point 'symbol)))
+
+ ;; jump from function begin to end
+ (goto-char (point-min))
+ (search-forward "static int");
+ (evilmi-jump-items)
+ (should (eq (following-char) ?}))
+ (should (string= (evilmi-sdk-curline) "}"))
+ ;; jump back
+ (evilmi-jump-items)
+ (should (eq (following-char) ?{))
+ (should (string= (evilmi-sdk-curline) "{"))
+
+ (should (eq major-mode 'c-mode)))))
(ert-run-tests-batch-and-exit)
;;; evil-matchit-tests.el ends here
- [nongnu] elpa/evil-matchit a91ea21c4a 141/244: Fix typo in readme, (continued)
- [nongnu] elpa/evil-matchit a91ea21c4a 141/244: Fix typo in readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit fb5807c096 129/244: Merge pull request #82 from et2010/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4f3928db11 157/244: let evil-repeat ignore evilmi jump, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 43be86d8c4 171/244: support css-in-js styled components, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2fc961d94b 122/244: fixed css-mode minor issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2001c5be5f 147/244: ocaml: improve validation of keywords, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8fa4c1390d 163/244: can change shortcut from "%" to "m", ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 665751dff8 165/244: Ignore trailing space in Ruby blocks with arguments, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 848dc06902 183/244: clean code&do, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1027459d44 180/244: more torelant to ruby syntax, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d75d41d7b3 197/244: add unit test for c,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit 25ad66d397 190/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 289982cbee 192/244: doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9b228b097a 242/244: easier to add own rules, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 3417dbb275 117/244: Add ocaml support, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 80413a836a 121/244: Merge pull request #79 from msaffer/patch-1, ELPA Syncer, 2022/01/06
- [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