[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 7c7aae7206 052/143: Add edit entry test, fix
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 7c7aae7206 052/143: Add edit entry test, fix regular expressions |
Date: |
Mon, 19 Feb 2024 15:58:53 -0500 (EST) |
branch: externals/hyperbole
commit 7c7aae72062bf9241767be4e87f4a60ec0dcda3e
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>
Add edit entry test, fix regular expressions
---
ChangeLog | 2 +-
test/hyrolo-tests.el | 85 ++++++++++++++++++++++++++++++++++++----------------
2 files changed, 61 insertions(+), 26 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 50eddf1d3d..627054c7fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,7 @@
(hyrolo-tests--outline-next-visible-header)
(hyrolo-tests--tab-through-matches)
(hyrolo-tests--outline-hide-show-heading)
- (hyrolo-tests--outline-up-header)
+ (hyrolo-tests--outline-up-header, hyrolo-tests--edit-entry)
(hyrolo-tests--outline-next-visible-header-two-sections): Add test for
working with hyrolo matches.
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 5e714c5b1f..7052c5fc8c 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: 1-Jan-24 at 20:56:49 by Mats Lidell
+;; Last-Mod: 1-Jan-24 at 22:06:44 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -535,25 +535,25 @@ Example:
;; Move down
(should (looking-at-p "==="))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^* header 1"))
+ (should (looking-at-p "^\\* header 1"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^** header 1.2"))
+ (should (looking-at-p "^\\*\\* header 1\\.2"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^* header 2"))
+ (should (looking-at-p "^\\* header 2"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^** header 2.2"))
+ (should (looking-at-p "^\\*\\* header 2\\.2"))
(should (hact 'kbd-key "n"))
(should (eobp))
;; Move back up
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^** header 2.2"))
+ (should (looking-at-p "^\\*\\* header 2\\.2"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^* header 2"))
+ (should (looking-at-p "^\\* header 2"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^** header 1.2"))
+ (should (looking-at-p "^\\*\\* header 1\\.2"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^* header 1"))
+ (should (looking-at-p "^\\* header 1"))
(should (hact 'kbd-key "p"))
;; BUG: This fails in Emacs 29 and 30
@@ -579,11 +579,11 @@ Example:
;; Move to last header
(goto-char (point-max))
(forward-line -2)
- (should (looking-at-p "^*** header 2.2.3$"))
+ (should (looking-at-p "^\\*\\*\\* header 2\\.2\\.3$"))
(should (hact 'kbd-key "u"))
- (should (looking-at-p "^** header 2.2$"))
+ (should (looking-at-p "^\\*\\* header 2\\.2$"))
(should (hact 'kbd-key "u"))
- (should (looking-at-p "^* header 2$"))
+ (should (looking-at-p "^\\* header 2$"))
(should-error (hact 'kbd-key "u")))
(kill-buffer "*HyRolo*")
(hy-delete-file-and-buffer org-file))))
@@ -603,25 +603,25 @@ Example:
;; Move down
(should (looking-at-p "==="))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^* header-a 1$"))
+ (should (looking-at-p "^\\* header-a 1$"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^** header-a 1.2$"))
+ (should (looking-at-p "^\\*\\* header-a 1\\.2$"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^* header-b 1$"))
+ (should (looking-at-p "^\\* header-b 1$"))
(should (hact 'kbd-key "n"))
- (should (looking-at-p "^** header-b 1.2$"))
+ (should (looking-at-p "^\\*\\* header-b 1\\.2$"))
(should (hact 'kbd-key "n"))
(should (eobp))
;; Move back up
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^** header-b 1.2$"))
+ (should (looking-at-p "^\\*\\* header-b 1\\.2$"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^* header-b 1$"))
+ (should (looking-at-p "^\\* header-b 1$"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^** header-a 1.2$"))
+ (should (looking-at-p "^\\*\\* header-a 1\\.2$"))
(should (hact 'kbd-key "p"))
- (should (looking-at-p "^* header-a 1$"))
+ (should (looking-at-p "^\\* header-a 1$"))
(should (hact 'kbd-key "p"))
;; BUG: This fails in Emacs 29 and 30
@@ -648,10 +648,12 @@ Example:
;; Hide first line hides whole section
(should (looking-at-p "==="))
(should (hact 'kbd-key "h"))
- (should (looking-at-p "^===+\.\.\.$"))
+ (end-of-line)
+ (should (get-char-property (point) 'invisible))
(save-excursion
(next-line)
(should (eobp)))
+ (goto-char (point-min))
(should (hact 'kbd-key "a"))
(should (looking-at-p "^===+$"))
@@ -683,24 +685,57 @@ Example:
(should (hact 'kbd-key "TAB"))
(should (looking-at-p "^body 1$"))
(should (hact 'kbd-key "TAB"))
- (should (looking-at-p "^body 1.2"))
+ (should (looking-at-p "^body 1\\.2"))
(should (hact 'kbd-key "TAB"))
(should (looking-at-p "^body 2$"))
(should (hact 'kbd-key "TAB"))
- (should (looking-at-p "^body 2.2"))
+ (should (looking-at-p "^body 2\\.2"))
(should-error (hact 'kbd-key "TAB"))
- (should (looking-at-p "^body 2.2"))
+ (should (looking-at-p "^body 2\\.2"))
;; Search Up
(should (hact 'kbd-key "<backtab>"))
(should (looking-at-p "^body 2$"))
(should (hact 'kbd-key "<backtab>"))
- (should (looking-at-p "^body 1.2"))
+ (should (looking-at-p "^body 1\\.2"))
(should (hact 'kbd-key "<backtab>"))
(should (looking-at-p "^body 1$"))
(should-error (hact 'kbd-key "<backtab>")))
(kill-buffer "*HyRolo*")
(hy-delete-file-and-buffer org-file))))
+(ert-deftest hyrolo-tests--edit-entry ()
+ "Verify {e} brings up entry in new window."
+ (let* ((org-file (make-temp-file "hypb" nil ".org"
+ (hyrolo-tests--gen-outline "header" 1
"body" 2)))
+ (hyrolo-file-list (list org-file)))
+ (unwind-protect
+ (progn
+ (hyrolo-grep "body")
+ (should (string= "*HyRolo*" (buffer-name)))
+
+ ;; Search Down
+ (should (looking-at-p "==="))
+ (should (hact 'kbd-key "TAB"))
+ (should (looking-at-p "^body 1$"))
+
+ ;; Edit record
+ (let ((revisit-normally (concat "y" (if noninteractive " RET"))))
+ (with-simulated-input revisit-normally
+ (should (hact 'kbd-key "e"))))
+ (should (string= (buffer-name) (file-name-nondirectory org-file)))
+ (should (looking-at-p "^body 1$"))
+
+ ;; Edit next record
+ (switch-to-buffer "*HyRolo*")
+ (should (hact 'kbd-key "TAB"))
+ (should (looking-at-p "^body 1\\.2$"))
+ (should (hact 'kbd-key "e"))
+ (should (string= (buffer-name) (file-name-nondirectory org-file)))
+ (should (looking-at-p "^body 1\\.2$"))
+ )
+ (kill-buffer "*HyRolo*")
+ (hy-delete-file-and-buffer org-file))))
+
(provide 'hyrolo-tests)
;;; hyrolo-tests.el ends here
- [elpa] externals/hyperbole 8d9b7f0dde 032/143: hyrolo-tests.el - "*HyRolo*" literal to `hyrolo-display-buffer' var, (continued)
- [elpa] externals/hyperbole 8d9b7f0dde 032/143: hyrolo-tests.el - "*HyRolo*" literal to `hyrolo-display-buffer' var, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c2bf47c15b 068/143: xref is used by etags since 26.1 so use it unconditionally (#432), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 327f53f078 069/143: Mock y-or-n-p to avoid being prompted (#433), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole e88a3873ed 073/143: htype:def-symbol, htype:names, actype:def-symbol - Call update, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole eeb6aacd9f 075/143: Add more hyrolo show, hide and movement tests (#436), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 47d87c252f 113/143: HyRolo - resolve all outline movement issues and tests, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7b50db7eb0 085/143: Matsl rsw forward backward same level tests (#443), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 3d80bcbaf4 109/143: Merge branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 1078846a45 120/143: Update generation of README.md.html for increased reliability, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 970a5573f3 133/143: Merge branch 'rsw' into matsl-rsw-add-top-view-n-overview-tests, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7c7aae7206 052/143: Add edit entry test, fix regular expressions,
ELPA Syncer <=
- [elpa] externals/hyperbole 6009912456 128/143: Add type of but in error message, renamed but parameter, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7d485ab5ff 136/143: hbut:act-label: Add to match same func for ebuts and ibuts, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 9a39300fcb 135/143: Merge branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole d55d57664c 139/143: Remove ad hoc flycheck warnings (#468), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole ce463d27c9 143/143: Merge to rsw branch in prep for V8.0.2pre release, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 21c93a0c70 137/143: Reorder load of `org-macs', ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole da8fd61747 099/143: Remove package-lint dependency and string-replace compatibility code, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 74ba1fd580 104/143: Cleanup of flycheck/flymake info and warning messages (#449), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 9e77bdf62e 108/143: Fix cyclic call bug that made Elisp lookups slow in ChangeLog mode, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole dd2e0884ee 100/143: Merge pull request #450 from rswgnu/matsl-rsw-cleanup-package-lint-dependencies, ELPA Syncer, 2024/02/19