[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole f7e0d15ac8 04/13: More kotl mode tests with h
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole f7e0d15ac8 04/13: More kotl mode tests with hyrolo-fgrep |
Date: |
Fri, 1 Dec 2023 06:58:07 -0500 (EST) |
branch: externals/hyperbole
commit f7e0d15ac82f84a73fb37a32d6c9406612465da0
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>
More kotl mode tests with hyrolo-fgrep
---
ChangeLog | 8 ++++---
test/hyrolo-tests.el | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 65 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8ca2546bbc..027e2ddce6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,9 +3,11 @@
* test/hyrolo-tests.el (hyrolo-fgrep-and-goto-next-visible-org-heading)
(hyrolo-fgrep-and-goto-next-visible-kotl-heading)
(hyrolo-fgrep-and-goto-next-visible-outl-heading)
- (hyrolo-fgrep-and-goto-next-visible-md-heading): Add test for moving
- to next header and that action-key then brings you to the matching
- record.
+ (hyrolo-fgrep-and-goto-next-visible-md-heading)
+ (hyrolo-fgrep-and-goto-next-visible-kotl-heading-level-2)
+ (hyrolo-fgrep-and-goto-next-visible-kotl-heading-cell-2): Add test for
+ moving to next header and that action-key then brings you to the
+ matching record.
2023-11-25 Mats Lidell <matsl@gnu.org>
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 328ffe1d5c..53a9fe47fb 100644
--- a/test/hyrolo-tests.el
+++ b/test/hyrolo-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 19-Jun-21 at 22:42:00
-;; Last-Mod: 29-Nov-23 at 22:13:01 by Mats Lidell
+;; Last-Mod: 29-Nov-23 at 23:22:15 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -382,6 +382,65 @@ and {b} the previous same level cell."
(kill-buffer "*HyRolo*")
(delete-directory temporary-file-directory))))
+(ert-deftest hyrolo-fgrep-and-goto-next-visible-kotl-heading-level-2 ()
+ "Verify move to next heading, then action-key to go to record for kotl mode.
+Match a string in a level 2 child cell."
+ (let* ((temporary-file-directory (make-temp-file "hypb" t))
+ (kotl-file (make-temp-file "hypb" nil ".kotl"))
+ (hyrolo-file-list (list temporary-file-directory)))
+ (unwind-protect
+ (progn
+ (find-file kotl-file)
+ (insert "first")
+ (kotl-mode:add-child)
+ (insert "heading")
+ (kotl-mode:newline 1)
+ (insert "string")
+ (kotl-mode:newline 1)
+ (insert "more")
+ (hyrolo-fgrep "string")
+ (with-current-buffer "*HyRolo*"
+ (should (= (how-many "@loc>") 1))
+ (should (looking-at-p "==="))
+ (hyrolo-next-visible-heading 1)
+ (should (looking-at-p ".*1a\\. heading")))
+ (with-simulated-input "y RET" ; Do you want to revisit the file
normally now?
+ (action-key)
+ (should (equal (current-buffer) (find-buffer-visiting kotl-file)))
+ (should (looking-at-p "heading"))))
+ (hy-delete-file-and-buffer kotl-file)
+ (kill-buffer "*HyRolo*")
+ (delete-directory temporary-file-directory))))
+
+(ert-deftest hyrolo-fgrep-and-goto-next-visible-kotl-heading-cell-2 ()
+ "Verify move to next heading, then action-key to go to record for kotl mode.
+Match a string in the second cell."
+ (let* ((temporary-file-directory (make-temp-file "hypb" t))
+ (kotl-file (make-temp-file "hypb" nil ".kotl"))
+ (hyrolo-file-list (list temporary-file-directory)))
+ (unwind-protect
+ (progn
+ (find-file kotl-file)
+ (insert "first")
+ (kotl-mode:add-cell)
+ (insert "heading")
+ (kotl-mode:newline 1)
+ (insert "string")
+ (kotl-mode:newline 1)
+ (insert "more")
+ (hyrolo-fgrep "string")
+ (with-current-buffer "*HyRolo*"
+ (should (= (how-many "@loc>") 1))
+ (should (looking-at-p "==="))
+ (hyrolo-next-visible-heading 1)
+ (should (looking-at-p ".*2\\. heading")))
+ (with-simulated-input "y RET" ; Do you want to revisit the file
normally now?
+ (action-key)
+ (should (equal (current-buffer) (find-buffer-visiting kotl-file)))
+ (should (looking-at-p "heading"))))
+ (hy-delete-file-and-buffer kotl-file)
+ (kill-buffer "*HyRolo*")
+ (delete-directory temporary-file-directory))))
(provide 'hyrolo-tests)
;;; hyrolo-tests.el ends here
- [elpa] externals/hyperbole updated (9d596dcc72 -> 3692855fa8), ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 0702872981 02/13: Verify searching all file types with matches gives @loc> headers, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole f7e0d15ac8 04/13: More kotl mode tests with hyrolo-fgrep,
ELPA Syncer <=
- [elpa] externals/hyperbole 4e625d0fb9 01/13: Add test for demo key series M-x dired-other-window example, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole d842b4a0fc 03/13: Test moving to next header, then using action-key to get to record., ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole ae55b5cf79 11/13: Merge pull request #408 from rswgnu/hyrolo-test-cases, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 13abbb4e86 05/13: Add tests for ebut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 3dd0dc156b 06/13: Add tests for gbut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole e444389cdf 09/13: Merge branch 'master' into hyrolo-test-cases, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 12c2f5d851 12/13: Merge branch 'master' into add-tests-for-ebut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 3692855fa8 13/13: Merge pull request #410 from rswgnu/add-tests-for-ebut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 064c23c30e 07/13: Merge branch 'master' into add-key-series-test-for-braces, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 8d5e95c659 08/13: Merge pull request #406 from rswgnu/add-key-series-test-for-braces, ELPA Syncer, 2023/12/01