Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2025-10-05 Mats Lidell <matsl@gnu.org>

* test/demo-tests.el (fast-demo-outline-section-anchor-and-relative-line-number):
Run test using different default major-mode's.

2025-10-04 Mats Lidell <matsl@gnu.org>

* Makefile (run-bash): Run bash in docker container for use with the
Expand Down
26 changes: 15 additions & 11 deletions test/demo-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 30-Jan-21 at 12:00:00
;; Last-Mod: 31-Aug-25 at 20:43:39 by Bob Weiner
;; Last-Mod: 28-Sep-25 at 22:41:32 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand All @@ -29,6 +29,7 @@
(require 'hyrolo)
(require 'eww)
(require 'compile)
(require 'cl-lib)
(require 'hy-test-dependencies) ;; can install el-mock
(require 'hy-test-helpers "test/hy-test-helpers")

Expand Down Expand Up @@ -428,16 +429,19 @@
;; Implicit Buttons
(ert-deftest fast-demo-outline-section-anchor-and-relative-line-number ()
"Verify star outline section links with line and column works."
(dolist (link '("\"HY-NEWS#ORG MODE:3:6\"" "\"HY-NEWS#ORG MODE:L3:C6\""))
(unwind-protect
(let ((default-directory hyperb:dir))
(with-temp-buffer
(insert link)
(goto-char 3)
(action-key)
(should (string= (buffer-name (current-buffer)) "HY-NEWS"))
(should (looking-at-p "M-RET: Reworked"))))
(hy-test-helpers:kill-buffer "HY-NEWS"))))
(dolist (m '(fundamental-mode text-mode))
(ert-info ((format "With major-mode %s" m))
(cl-letf (((default-value 'major-mode) m))
(dolist (link '("\"HY-NEWS#ORG MODE:3:6\"" "\"HY-NEWS#ORG MODE:L3:C6\""))
(unwind-protect
(let ((default-directory hyperb:dir))
(with-temp-buffer
(insert link)
(goto-char 3)
(action-key)
(should (string= (buffer-name (current-buffer)) "HY-NEWS"))
(should (looking-at-p "M-RET: Reworked"))))
(hy-test-helpers:kill-buffer "HY-NEWS")))))))

(ert-deftest fast-demo-markdown-anchor-with-spaces ()
"Verify anchor with spaces works."
Expand Down