diff --git a/ChangeLog b/ChangeLog index 2da74041..0ed71ff2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2026-06-09 Mats Lidell + +* test/hbut-tests.el (hbut-tests--ibut-at-p-identifies-a-remote-pathname): + Remove comment. + +* test/hywiki-tests.el (hywiki-tests--edit-string-pairs): Uncomment + working test case. + +* test/hyrolo-tests.el (hyrolo-tests--grep-or-fgrep): Use cl-letf for + mocking call-interactively. Functions with optional arguments does not + work with el-mock and native compilation. The mock is called with the + optional args set to nil causing it to see different number of + arguments depending on whether the code is natively compiled or not. + 2026-06-07 Bob Weiner * hbut.el (ibut:to-text): Fix missing let of 'name-end' and assign a value. diff --git a/test/hbut-tests.el b/test/hbut-tests.el index 018daf3a..e72c5c77 100644 --- a/test/hbut-tests.el +++ b/test/hbut-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 30-may-21 at 09:33:00 -;; Last-Mod: 12-Apr-26 at 15:11:31 by Bob Weiner +;; Last-Mod: 9-Jun-26 at 00:01:32 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -780,7 +780,7 @@ See #10 for the proper way to add an ibutton name. (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname)) (goto-char (- (point-max) 5)) (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname)) - (goto-char 8) ;; ibtypes::mail-address !! + (goto-char 8) (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname)))) (ert-deftest hypb--gbut-act-with-web-link () diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el index 90defd8a..046866f1 100644 --- a/test/hyrolo-tests.el +++ b/test/hyrolo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 19-Jun-21 at 22:42:00 -;; Last-Mod: 1-Jun-26 at 00:09:22 by Bob Weiner +;; Last-Mod: 8-Jun-26 at 23:42:26 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -2010,12 +2010,14 @@ match (ert-deftest hyrolo-tests--grep-or-fgrep () "Verify `hyrolo-grep-or-fgrep' calls hyrolo grep or fgrep based on prefix arg. Uses mocks to verify the call path." - (with-mock - (mock (call-interactively 'hyrolo-grep)) - (hyrolo-grep-or-fgrep)) - (with-mock - (mock (call-interactively 'hyrolo-fgrep)) - (hyrolo-grep-or-fgrep '(4)))) + (let ((captured-args nil)) + (cl-letf (((symbol-function 'call-interactively) + (lambda (cmd &optional record-flag keys) + (setq captured-args (list cmd record-flag keys))))) + (hyrolo-grep-or-fgrep) + (should (equal (car captured-args) #'hyrolo-grep)) + (hyrolo-grep-or-fgrep '(4)) + (should (equal (car captured-args) #'hyrolo-fgrep))))) (ert-deftest hyrolo-tests--kill () "Verify `hyrolo-kill' deletes hyrolo items and handles error cases. diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el index 589382e8..c2b8afb6 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: 12-Apr-26 at 15:11:29 by Bob Weiner +;; Last-Mod: 9-Jun-26 at 16:26:28 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -50,10 +50,7 @@ named WikiReferent with a non-page referent type." (defconst hywiki-tests--edit-string-pairs [ - ;; !! TODO: This test fails - ;; ("\"WikiWord#section with spaces\"" "\"{WikiWord#section} with spaces") ;; shrink highlight to "{WikiWord#section} - - ;; These tests pass + ("\"WikiWord#section with spaces\"" "\"{WikiWord#section} with spaces") ;; shrink highlight to "{WikiWord#section} ("Hi#a cd" "{Hi#ab} cd") ("\"WikiWord#a b c" "\"{WikiWord#a} b") ("Hi" "{Hi}")