branch: externals/hyperbole
commit f2c6081a9c39d62d1c65e4c7880094fb8994da54
Author: Mats Lidell <mats.lid...@lidells.se>
Commit: Mats Lidell <mats.lid...@lidells.se>

    Add fast-demo test for outline section with line and column
---
 ChangeLog          |  6 ++++++
 FAST-DEMO          |  6 +++---
 test/demo-tests.el | 17 ++++++++++++++++-
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d01e670f6f..ef08cf8ce4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-12-29  Mats Lidell  <ma...@gnu.org>
+
+* test/demo-tests.el
+    (fast-demo-outline-section-anchor-and-relative-line-number-test): Add
+    test for outline section with line and column.
+
 2023-12-28  Bob Weiner  <r...@gnu.org>
 
 * hypb-ert.el (hypb-ert-def-at-p): Add support for `ert-deftest-async' from the
diff --git a/FAST-DEMO b/FAST-DEMO
index becac6b553..878b9081e1 100644
--- a/FAST-DEMO
+++ b/FAST-DEMO
@@ -135,11 +135,11 @@
 
 ** Pathname Implicit Buttons
 
-    "HY-NEWS#ORG MODE:2:6"   - outline section anchor & relative line number
+    "HY-NEWS#ORG MODE:3:6"   - outline section anchor & relative line number
 
        Display the file, "HY-NEWS", go to the star-outline section 'ORG
-       MODE', move 2 lines into that section and then move 6 characters
-       forward.  "HY-NEWS#ORG MODE:L2:C6" with the line and column numbers
+       MODE', move 3 lines into that section and then move 6 characters
+       forward.  "HY-NEWS#ORG MODE:L3:C6" with the line and column numbers
        labeled works as well.
 
        Existing files and pathnames without spaces are also recognized without
diff --git a/test/demo-tests.el b/test/demo-tests.el
index be116cd87e..c0c0260de6 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <ma...@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     25-Dec-23 at 23:30:20 by Mats Lidell
+;; Last-Mod:     28-Dec-23 at 18:58:46 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -425,6 +425,21 @@
         (hy-test-helpers:should-last-message "Factorial of 5 = 120"))
     (hy-test-helpers:kill-buffer "DEMO")))
 
+;;; Fast demo
+;; Implicit Buttons
+(ert-deftest fast-demo-outline-section-anchor-and-relative-line-number-test ()
+  "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"))))
+
 ;; Fast demo key series
 (ert-deftest fast-demo-key-series-help-buffer ()
   "Action key on C-hA brings up help buffer for action key."

Reply via email to