branch: externals/hyperbole
commit 7a10e39a55fe7b989913b072e10951725c182e86
Author: Mats Lidell <[email protected]>
Commit: GitHub <[email protected]>
Use position as given from step definition (#860)
* test/hywiki-tests.el (hywiki-tests--run-test-case): Use pos as given
by the step definition. If an illegal position results the test
specification is wrong and need to be changed. Give an error
message that explains the problem.
---
ChangeLog | 7 +++++++
test/hywiki-tests.el | 7 +++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d2716734c8..3bcd147e12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-02-09 Mats Lidell <[email protected]>
+
+* test/hywiki-tests.el (hywiki-tests--run-test-case): Use pos as given
+ by the step definition. If an illegal position results the test
+ specification is wrong and need to be changed. Give an error
+ message that explains the problem.
+
2026-02-09 Bob Weiner <[email protected]>
* test/hywiki-tests.el (hywiki-tests--edit): Report expected errors as messages
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index 3adbfd4223..62493b6048 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -1560,11 +1560,10 @@ point when the function is called."
(hywiki-tests--command-execute #'backward-delete-char
1)))
(hywiki-tests--verify-hywiki-word step vfy)))
((and (symbolp step) (string-prefix-p "p" (symbol-name step)))
- (let* ((pos (string-to-number (substring (symbol-name step)
1)))
- (newpos (max (min (+ origin (1- pos)) (point-max))
- (point-min))))
+ (let* ((pos (string-to-number (substring (symbol-name step)
1)))
+ (newpos (+ origin (1- pos))))
(when (or (> (point-min) newpos) (< (point-max) newpos))
- (ert-fail (format "New point: '%s' is outside of buffer"
newpos)))
+ (ert-fail (format "Error in test specification. Step '%s'
moves point to pos '%s' outside of buffer" step newpos)))
(goto-char newpos))
(hywiki-tests--verify-hywiki-word step vfy))
(t (ert-fail (format "Unknown step: '%s' in WikiWord
verification" step)))))))))