Skip to content

Commit dea72c9

Browse files
authored
Add test for ending a WikiWord with a space (#604)
Keep failing test for ending WikiWord with a RET. Mark tests as expected fail since using RET as well as SPC should work!?
1 parent 9ebfcfe commit dea72c9

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

test/hywiki-tests.el

+27-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell
44
;;
55
;; Orig-Date: 18-May-24 at 23:59:48
6-
;; Last-Mod: 10-Nov-24 at 23:05:28 by Mats Lidell
6+
;; Last-Mod: 11-Nov-24 at 22:53:15 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -299,13 +299,19 @@ Both mod-time and checksum must be changed for a test to return true."
299299

300300
(ert-deftest hywiki-tests--face-property-for-wikiword-with-wikipage ()
301301
"Verify WikiWord for a wiki page gets face property hywiki-word-face."
302+
:expected-result :failed
302303
(skip-unless (not noninteractive))
303304
(let* ((hsys-org-enable-smart-keys t)
304305
(hywiki-directory (make-temp-file "hywiki" t))
305306
(wikipage (hywiki-add-page "WikiWord")))
306307
(unwind-protect
307308
(progn
308309
(hywiki-tests--remove-hywiki-hooks)
310+
(with-temp-buffer
311+
(hywiki-mode 1)
312+
(with-hywiki-buttonize-and-insert-hooks (insert "WikiWord "))
313+
(goto-char 4)
314+
(should (hproperty:but-get (point) 'face hywiki-word-face)))
309315
(with-temp-buffer
310316
(hywiki-mode 1)
311317
(with-hywiki-buttonize-and-insert-hooks
@@ -395,18 +401,30 @@ Both mod-time and checksum must be changed for a test to return true."
395401

396402
(ert-deftest hywiki-tests--convert-words-to-org-link ()
397403
"Verify `hywiki-convert-words-to-org-links' converts WikiWords to org links."
404+
:expected-result :failed
398405
(skip-unless (not noninteractive))
399406
(let* ((hywiki-directory (make-temp-file "hywiki" t))
400407
(wikipage (hywiki-add-page "WikiWord")))
401408
(unwind-protect
402-
(with-temp-buffer
403-
(hywiki-mode 1)
404-
(insert "WikiWord")
405-
(newline nil t)
406-
(goto-char 4)
407-
(hywiki-convert-words-to-org-links)
408-
(should (string= "[[hy:WikiWord]]\n"
409-
(buffer-substring-no-properties (point-min) (point-max)))))
409+
(progn
410+
(hywiki-tests--remove-hywiki-hooks)
411+
(with-temp-buffer
412+
(hywiki-mode 1)
413+
(with-hywiki-buttonize-and-insert-hooks (insert "WikiWord "))
414+
(goto-char 4)
415+
(hywiki-convert-words-to-org-links)
416+
(should (string= "[[hy:WikiWord]] "
417+
(buffer-substring-no-properties (point-min) (point-max)))))
418+
(with-temp-buffer
419+
(hywiki-mode 1)
420+
(with-hywiki-buttonize-and-insert-hooks
421+
(insert "WikiWord")
422+
(newline nil t))
423+
(goto-char 4)
424+
(hywiki-convert-words-to-org-links)
425+
(should (string= "[[hy:WikiWord]]\n"
426+
(buffer-substring-no-properties (point-min) (point-max))))))
427+
(hywiki-tests--add-hywiki-hooks)
410428
(hywiki-mode 0)
411429
(hy-delete-file-and-buffer wikipage)
412430
(hy-delete-dir-and-buffer hywiki-directory))))

0 commit comments

Comments
 (0)