summaryrefslogtreecommitdiff
path: root/test/src/data-tests.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-12-18 12:21:27 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2018-12-18 12:23:02 -0800
commitcdaaaf2e1bd1f8ad2784ffc8265aa642da2d1190 (patch)
tree3dbe9cc04690882db9d4fae33a1d69bc32b996a2 /test/src/data-tests.el
parent5a04e8261458d887c7b7d7c259053f236379cf78 (diff)
downloademacs-cdaaaf2e1bd1f8ad2784ffc8265aa642da2d1190.tar.gz
Support (ash INTEGER BIGNUM)
* src/data.c (emacs_mpz_mul_2exp): 2nd arg is now a nonnegative EMACS_INT not mp_bitcnt_t, to simplify checking. (Fash): Support COUNT values that are bignums or that exceed mp_bitcnt_t range. * test/src/data-tests.el (data-tests-ash-lsh): Test this.
Diffstat (limited to 'test/src/data-tests.el')
-rw-r--r--test/src/data-tests.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index d41c7623289..bbf7e2a2394 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -656,6 +656,10 @@ comparing the subr with a much slower lisp implementation."
(ert-deftest data-tests-ash-lsh ()
(should (= (ash most-negative-fixnum 1)
(* most-negative-fixnum 2)))
+ (should (= (ash 0 (* 2 most-positive-fixnum)) 0))
+ (should (= (ash 1000 (* 2 most-negative-fixnum)) 0))
+ (should (= (ash -1000 (* 2 most-negative-fixnum)) -1))
+ (should (= (ash (* 2 most-negative-fixnum) (* 2 most-negative-fixnum)) -1))
(should (= (lsh most-negative-fixnum 1)
(* most-negative-fixnum 2)))
(should (= (ash (* 2 most-negative-fixnum) -1)