]> git.eshelyaron.com Git - emacs.git/commitdiff
Stronger checking in line-number-at-pos tests
authorMattias Engdegård <mattiase@acm.org>
Thu, 13 Apr 2023 15:35:45 +0000 (17:35 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 13 Apr 2023 15:35:45 +0000 (17:35 +0200)
* test/lisp/simple-tests.el (line-number-at-pos-keeps-restriction)
(line-number-at-pos-keeps-point): Check all return values.

test/lisp/simple-tests.el

index 28d8120f1434e4b46a7941c22dd7cda1e45217a3..7dabb735522c801d50e752743712f7a3415ef42e 100644 (file)
@@ -839,7 +839,7 @@ See Bug#21722."
     (forward-line 2)
     (narrow-to-region (pos-bol) (pos-eol))
     (should (equal (line-number-at-pos) 1))
-    (line-number-at-pos nil t)
+    (should (equal (line-number-at-pos nil t) 3))
     (should (equal (line-number-at-pos) 1))))
 
 (ert-deftest line-number-at-pos-keeps-point ()
@@ -849,8 +849,8 @@ See Bug#21722."
       (goto-char (point-min))
       (forward-line 2)
       (setq pos (point))
-      (line-number-at-pos)
-      (line-number-at-pos nil t)
+      (should (equal (line-number-at-pos) 3))
+      (should (equal (line-number-at-pos nil t) 3))
       (should (equal pos (point))))))
 
 (ert-deftest line-number-at-pos-when-passing-point ()