Skip to content

Commit

Permalink
compat-tests: Move bignum tests into 'should' forms
Browse files Browse the repository at this point in the history
  • Loading branch information
phikal committed Feb 23, 2025
1 parent 49714ac commit c7e42f9
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions compat-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3259,14 +3259,14 @@
(should (oddp -1))
(should (oddp 3))
(should (oddp most-positive-fixnum))
(when (fboundp 'bignump)
(should (oddp (+ most-positive-fixnum 2))))
(should (or (not (fboundp 'bignump))
(oddp (+ most-positive-fixnum 2))))
(should-not (oddp 0))
(should-not (oddp -2))
(should-not (oddp 10))
(should-not (oddp (1- most-positive-fixnum)))
(when (fboundp 'bignump)
(should-not (oddp (1+ most-positive-fixnum))))
(should-not (or (not (fboundp 'bignump))
(oddp (1+ most-positive-fixnum))))
(should-error (oddp 1.0))
(should-error (oddp 0.0)))

Expand All @@ -3275,31 +3275,31 @@
(should (evenp -2))
(should (evenp 10))
(should (evenp (1- most-positive-fixnum)))
(when (fboundp 'bignump)
(should (evenp (1+ most-positive-fixnum))))
(should (or (not (fboundp 'bignump))
(evenp (1+ most-positive-fixnum))))
(should-not (evenp 1))
(should-not (evenp -1))
(should-not (evenp 3))
(should-not (evenp most-positive-fixnum))
(when (fboundp 'bignump)
(should-not (evenp (+ most-positive-fixnum 2))))
(should-not (or (not (fboundp 'bignump))
(evenp (+ most-positive-fixnum 2))))
(should-error (evenp 1.0))
(should-error (evenp 0.0)))

(ert-deftest compat-plusp ()
(should (plusp 1))
(should (plusp most-positive-fixnum))
(when (fboundp 'bignump)
(should (plusp (1+ most-positive-fixnum))))
(should (or (not (fboundp 'bignump))
(plusp (1+ most-positive-fixnum))))
(should (plusp 1.0))
(should (plusp 1.0e+INF))
(should (plusp 1e-100))
(with-temp-buffer (should (plusp (point-max-marker))))
(should-not (plusp 0))
(should-not (plusp 0.0))
(should-not (plusp most-negative-fixnum))
(when (fboundp 'bignump)
(should-not (plusp (1- most-negative-fixnum))))
(should-not (or (not (fboundp 'bignump))
(plusp (1- most-negative-fixnum))))
(should-not (plusp -1.0))
(should-not (plusp -1.0e+INF))
(should-not (plusp -1e-100))
Expand All @@ -3312,15 +3312,15 @@
(should-not (minusp 0))
(should-not (minusp 0.0))
(should (minusp most-negative-fixnum))
(when (fboundp 'bignump)
(should (minusp (1- most-negative-fixnum))))
(should (or (not (fboundp 'bignump))
(minusp (1- most-negative-fixnum))))
(should (minusp -1.0))
(should (minusp -1.0e+INF))
(should (minusp -1e-100))
(should-not (minusp 1))
(should-not (minusp most-positive-fixnum))
(when (fboundp 'bignump)
(should-not (minusp (1+ most-positive-fixnum))))
(should-not (or (not (fboundp 'bignump))
(minusp (1+ most-positive-fixnum))))
(should-not (minusp 1.0))
(should-not (minusp 1.0e+INF))
(should-not (minusp 1e-100))
Expand Down

0 comments on commit c7e42f9

Please sign in to comment.