[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 12d84d101f 04/14: Call hook function explicit
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 12d84d101f 04/14: Call hook function explicitly to simulate interactive use |
Date: |
Mon, 11 Nov 2024 03:58:23 -0500 (EST) |
branch: externals/hyperbole
commit 12d84d101ffc7221f29dcd72821283656cdd8579
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>
Call hook function explicitly to simulate interactive use
Uses hywiki-maybe-highlight-page-names before checking
highlighting. Modified two old functions to use this so tests could be
made non interactive.
---
ChangeLog | 3 ++-
test/hywiki-tests.el | 55 +++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index eddbb5a134..ed7fc2c911 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,8 @@
* test/hywiki-tests.el (hywiki-tests--word-is-p)
(hywiki-tests--directory-edit)
- (hywiki-tests--verify-face-property-when-editing-wikiword): Add hywiki
+ (hywiki-tests--verify-face-property-when-editing-wikiword)
+ (hywiki-tests--verify-face-property-when-editing-wikiword-first-char): Add
hywiki
tests.
* hywiki.el (hywiki-directory-edit): Remove character classes. Not
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index dce2492e1d..a724720f9f 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell
;;
;; Orig-Date: 18-May-24 at 23:59:48
-;; Last-Mod: 2-Nov-24 at 18:23:22 by Mats Lidell
+;; Last-Mod: 2-Nov-24 at 23:29:41 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -272,7 +272,6 @@ Both mod-time and checksum must be changed for a test to
return true."
(ert-deftest hywiki-tests--face-property-for-wikiword-with-wikipage ()
"Verify WikiWord for a wiki page gets face property hywiki-word-face."
- (skip-unless (not noninteractive))
(let* ((hsys-org-enable-smart-keys t)
(hywiki-directory (make-temp-file "hywiki" t))
(wikipage (hywiki-add-page "WikiWord")))
@@ -282,6 +281,7 @@ Both mod-time and checksum must be changed for a test to
return true."
(insert "WikiWord")
(newline nil t)
(goto-char 4)
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
(should (hproperty:but-get (point) 'face hywiki-word-face)))
(hywiki-mode 0)
(hy-delete-file-and-buffer wikipage)
@@ -289,7 +289,6 @@ Both mod-time and checksum must be changed for a test to
return true."
(ert-deftest hywiki-tests--no-face-property-for-no-wikipage ()
"Verify WikiWord for no wiki page does not get face property
hywiki-word-face."
- (skip-unless (not noninteractive))
(let* ((hsys-org-enable-smart-keys t)
(hywiki-directory (make-temp-file "hywiki" t)))
(unwind-protect
@@ -298,32 +297,62 @@ Both mod-time and checksum must be changed for a test to
return true."
(insert "WikiWord")
(newline nil t)
(goto-char 4)
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
(should-not (hproperty:but-get (point) 'face hywiki-word-face)))
(hy-delete-dir-and-buffer hywiki-directory))))
(ert-deftest hywiki-tests--verify-face-property-when-editing-wikiword ()
- "Verify that the face property is added and removed when the WikiWord is
edited."
- :expected-result :failed
- (skip-unless (not noninteractive))
+ "Verify face property changes when WikiWord is edited."
(let* ((hywiki-directory (make-temp-file "hywiki" t))
- (wikipage (hywiki-add-page "WikiWord"))
- (wikipage2 (hywiki-add-page "AnyWord")))
+ (wikipage (hywiki-add-page "WikiWord")))
(unwind-protect
- (progn
- (find-file wikipage2)
+ (with-temp-buffer
(hywiki-mode 1)
- (insert "Wikiord")
- (newline nil t)
+ (insert "Wikiord ")
(goto-char 5)
(should (looking-at-p "ord"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
(should-not (hproperty:but-get (point) 'face hywiki-word-face))
(insert "W")
(goto-char 5)
(should (looking-at-p "Word"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
+ (should (hproperty:but-get (point) 'face hywiki-word-face))
+
+ (delete-char 1)
+ (should (looking-at-p "ord"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
+ (should-not (hproperty:but-get (point) 'face hywiki-word-face)))
+ (hywiki-mode 0)
+ (hy-delete-files-and-buffers (list wikipage))
+ (hy-delete-dir-and-buffer hywiki-directory))))
+
+(ert-deftest
hywiki-tests--verify-face-property-when-editing-wikiword-first-char ()
+ "Verify face property changes when WikiWord is edited in the first char
position."
+ (let* ((hywiki-directory (make-temp-file "hywiki" t))
+ (wikipage (hywiki-add-page "WikiWord")))
+ (unwind-protect
+ (with-temp-buffer
+ (hywiki-mode 1)
+ (insert "WikiWord ")
+ (goto-char 1)
+ (should (looking-at-p "Wiki"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
+ (should (hproperty:but-get (point) 'face hywiki-word-face))
+
+ (delete-char 1)
+ (should (looking-at-p "iki"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
+ (should-not (hproperty:but-get (point) 'face hywiki-word-face))
+
+ (insert "W")
+ (goto-char 1)
+ (should (looking-at-p "Wiki"))
+ (hywiki-maybe-highlight-page-names (point-min) (point-max))
(should (hproperty:but-get (point) 'face hywiki-word-face)))
(hywiki-mode 0)
- (hy-delete-files-and-buffers (list wikipage wikipage2))
+ (hy-delete-files-and-buffers (list wikipage))
(hy-delete-dir-and-buffer hywiki-directory))))
(ert-deftest hywiki-tests--convert-words-to-org-link ()
- [elpa] externals/hyperbole 2ec382cdaf 03/14: Add test case for verifying property is updated on edit, (continued)
- [elpa] externals/hyperbole 2ec382cdaf 03/14: Add test case for verifying property is updated on edit, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole aecb4ec856 06/14: Revert "Use plain star wildcard and add a test", ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 1dd924149f 05/14: Handle hooks to mimic redisplay behavior, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 74e7c4eb4e 07/14: make comment text into an ibut, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 9f2eff61f2 10/14: Merge pull request #600 from rswgnu/add-more-hywiki-tests, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 498f28757c 12/14: Merge pull request #601 from rswgnu/make-comment-work-as-an-info-ibut, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 8a5b3e2327 01/14: Add hywiki-word-is-p test, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 9ebfcfe2e3 14/14: Merge pull request #602 from rswgnu/rsw, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 68e68cd893 09/14: hyrolo.el (hyrolo-grep-file) - Fix bug (gh#rswgnu/hyperbole/599), ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole a535696bb4 08/14: Support latest Treemacs and HyWiki page navigation with it, ELPA Syncer, 2024/11/11
- [elpa] externals/hyperbole 12d84d101f 04/14: Call hook function explicitly to simulate interactive use,
ELPA Syncer <=
- [elpa] externals/hyperbole c98bdbf501 02/14: Use plain star wildcard and add a test, ELPA Syncer, 2024/11/11