]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix thinko in subr-test-zerop
authorStefan Kangas <stefankangas@gmail.com>
Mon, 24 Feb 2025 17:38:28 +0000 (18:38 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 26 Feb 2025 09:35:18 +0000 (10:35 +0100)
* test/lisp/subr-tests.el (subr-test-zerop): Fix test.
Reported by Pip Cet <pipcet@protonmail.com>.

(cherry picked from commit 3f72af997308db3160f05ace47602f1f2b8afd9c)

test/lisp/subr-tests.el

index 5684a08254dfd73d37b0f815c8f000c560aadfef..702502627f2cf014f7e933ab11e30881182dafea 100644 (file)
@@ -39,8 +39,8 @@
   (should-not (zerop 0.0e+NaN))
   (should-not (zerop float-pi))
   (should-not (zerop 1.0e+INF))
-  (should-not (zerop (random most-positive-fixnum)))
-  (should-not (zerop (- (random (- most-negative-fixnum)))))
+  (should-not (zerop (1+ (random most-positive-fixnum))))
+  (should-not (zerop (- (1- (random (- most-negative-fixnum))))))
   (should-not (zerop (1+ most-positive-fixnum)))
   (should-not (zerop (1- most-negative-fixnum)))
   (should-error (zerop "-5") :type 'wrong-type-argument))