diff tests/automated/lisp-tests.el @ 5905:85fd1ab80057

Fix a bug in #'parse-integer with negative bignums and non-nil JUNK-ALLOWED src/ChangeLog addition: 2015-05-08 Aidan Kehoe <kehoea@parhasard.net> * data.c (parse_integer): Fix a bug here with the interaction of negative bignums and a non-zero JUNK-ALLOWED argument. tests/ChangeLog addition: 2015-05-08 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Check for a bug just fixed with the interaction of negative bignums and :junk-allowed non-nil.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 08 May 2015 16:24:57 +0100
parents d3d073aceaea
children 48386fd60fd0
line wrap: on
line diff
--- a/tests/automated/lisp-tests.el	Fri May 08 14:33:46 2015 +0100
+++ b/tests/automated/lisp-tests.el	Fri May 08 16:24:57 2015 +0100
@@ -3612,8 +3612,15 @@
                      "checking an overflow bug has been fixed")
              (Assert (eql (ignore-errors (parse-integer "-100000000"
                                                         :radix 16))
-                          (if (featurep 'bignum) (- (lsh 1 32) nil))
+                          (if (featurep 'bignum) (- (lsh 1 32)) nil))
                      "checking an overflow bug has been fixed, negative int")
+             (Assert (eql (ignore-errors (parse-integer
+                                           (format "%d4/" most-negative-fixnum)
+                                           :junk-allowed t))
+                          (if (featurep 'bignum)
+                              (- (* most-negative-fixnum 10) 4)
+                            nil))
+                      "checking a bug with :junk-allowed, negative bignum")
              (Check-Error invalid-argument (parse-integer "0123456789"
                                             :radix 8))
              (Check-Error invalid-argument (parse-integer "abc"))