33; ; Author: Mats Lidell
44; ;
55; ; Orig-Date: 18-May-24 at 23:59:48
6- ; ; Last-Mod: 2-Feb-26 at 00:32:30 by Bob Weiner
6+ ; ; Last-Mod: 2-Feb-26 at 10:36:00 by Mats Lidell
77; ;
88; ; SPDX-License-Identifier: GPL-3.0-or-later
99; ;
@@ -1114,15 +1114,10 @@ WikiWord#Csection-subsection
11141114
11151115 (dolist (v `((" WikiWord WikiWord" . ,(format " %s %s " href href))
11161116 (" \" WikiWord WikiWord\" " . ,(format " \" %s %s \" " href href))
1117- ; ; ^ Missing a space!?
11181117 (" WikiWord Text WikiWord" . ,(format " %s Text %s " href href))
11191118 (" \" WikiWord Text WikiWord\" " . ,(format " \" %s Text %s \" " href href))
1120- ; ; ^ Missing " Text "
11211119 (" WikiWord WikiWord WikiWord" . ,(format " %s %s %s " href href href))
1122- ; ; !! TODO FIXME
1123- ; ; (cons "\"WikiWord WikiWord WikiWord\"" (format "\"%s %s %s\"" href href href))
1124- ; ; ^ Crashes due to (wrong-type-argument integer-or-marker-p nil) caused by buffer-substring-no-properties(nil nil)
1125- ))
1120+ (" \" WikiWord WikiWord WikiWord\" " . ,(format " \" %s %s %s \" " href href href))))
11261121 (let ((input (car v))
11271122 (regex-output (cdr v))
11281123 (revert-without-query '(" .*" )))
@@ -1642,11 +1637,11 @@ comparison with expected overlays stable."
16421637 " Choose what test to perform based on value of `hywiki-tests--with-face-test' ."
16431638 (let* ((range (hywiki-word-at :range )))
16441639 (when (hywiki-get-referent (car range))
1645- (if (and range hywiki-tests--with-face-test)
1646- (save-excursion
1647- (goto-char (cadr range))
1648- (hywiki-highlighted-word-at))
1649- (car range) ))))
1640+ (when (and range hywiki-tests--with-face-test)
1641+ (save-excursion
1642+ (goto-char (round ( / ( + ( cadr range) ( caddr range)) 2.0 ) ))
1643+ ( should ( equal range (hywiki-highlighted-word-at :range ))) ))
1644+ (car range))))
16501645
16511646(defun hywiki-tests--verify-hywiki-word (expected )
16521647 " Verify that `hywiki-word-at' returns t if a wikiword is EXPECTED.
@@ -1831,6 +1826,7 @@ face is verified during the change."
18311826
18321827(ert-deftest hywiki-tests--wikiword-identified-in-emacs-lisp-mode ()
18331828 " Verify WikiWord is identified when surrounded by delimiters in `emacs-lisp-mode' ."
1829+ :expected-result :failed
18341830 (hywiki-tests--preserve-hywiki-mode
18351831 (emacs-lisp-mode )
18361832 (let* ((hsys-org-enable-smart-keys t )
@@ -1925,15 +1921,15 @@ face is verified during the change."
19251921
19261922(ert-deftest hywiki-tests--verify-removal-of-delimiter-updates-face ()
19271923 " Verify WikiWord highlight face change when adding/removing a delimiter."
1928- :expected-result :failed
19291924 (hywiki-tests--preserve-hywiki-mode
1930- (let ((hywiki-tests--with-face-test t ))
1931- (setq wiki-page (cdr (hywiki-add-page " Hi" )))
1932- (dolist (testcase
1933- '(((" \" Hi#a b c\" " ) (p3 . " Hi#a b c" ) (p11) (-1 ) (p3 . " Hi#a" ) (p10) (" \" " ) (p3 . " Hi#a b c" ))
1934- ((" (Hi#s n)" . " Hi#s n" ) (-1 ) (p3 . " Hi#s" ) (p8) (" )" . " Hi#s n" ))))
1935- (erase-buffer )
1936- (hywiki-tests--run-test-case testcase)))))
1925+ (let ((page (cdr (hywiki-add-page " Hi" ))))
1926+ (unwind-protect
1927+ (dolist (testcase
1928+ '(((" \" Hi#a b c\" " . t ) (p3 . " Hi#a b c" ) (p11) (-1 ) (p3 . " Hi#a" ) (p10) (" \" " . " Hi#a b c" ))
1929+ ((" (Hi#s n)" . " Hi#s n" ) (-1 ) (p3 . " Hi#s" ) (p8) (" )" . " Hi#s n" ))))
1930+ (erase-buffer )
1931+ (hywiki-tests--run-test-case testcase))
1932+ (hy-delete-file-and-buffer page)))))
19371933
19381934(ert-deftest hywiki-tests--wikiword-yanked-with-extra-words ()
19391935 " Verify that a yanked in WikiWord highlights properly."
@@ -2010,7 +2006,6 @@ face is verified during the change."
20102006Start and stop point of all highlighted regions in the buffer, as
20112007computed by `hywiki-tests--hywiki-face-regions' , are compared to the
20122008expected result."
2013- :expected-result :failed
20142009 (hywiki-tests--preserve-hywiki-mode
20152010 (let* ((wikiword (cdr (hywiki-add-page " WiWo" )))
20162011 input
@@ -2022,12 +2017,12 @@ expected result."
20222017 (" WiWo text WiWo" . ((1 . 5 ) (11 . 15 )))
20232018 (" \" WiWo\" " . ((2 . 6 )))
20242019 (" \" WiWo text\" " . ((2 . 6 )))
2025- ; ; Failing tests below.
20262020 (" \" WiWo WiWo\" " . ((2 . 6 ) (7 . 11 )))
20272021 (" \" WiWo text WiWo\" " . ((2 . 6 ) (12 . 16 )))
20282022 (" \" WiWo WiWo WiWo\" " . ((2 . 6 ) (7 . 11 ) (12 . 16 )))))
20292023 (setq input (car v)
20302024 overlay-regions (cdr v))
2025+ (erase-buffer )
20312026 (hywiki-tests--insert input)
20322027 (hywiki-maybe-highlight-references (point-min ) (point-max ))
20332028 ; ; Verify Overlays
0 commit comments