comparison 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
comparison
equal deleted inserted replaced
5904:ee27ca517e90 5905:85fd1ab80057
3610 :radix 16)) 3610 :radix 16))
3611 (if (featurep 'bignum) (lsh 1 32) nil)) 3611 (if (featurep 'bignum) (lsh 1 32) nil))
3612 "checking an overflow bug has been fixed") 3612 "checking an overflow bug has been fixed")
3613 (Assert (eql (ignore-errors (parse-integer "-100000000" 3613 (Assert (eql (ignore-errors (parse-integer "-100000000"
3614 :radix 16)) 3614 :radix 16))
3615 (if (featurep 'bignum) (- (lsh 1 32) nil)) 3615 (if (featurep 'bignum) (- (lsh 1 32)) nil))
3616 "checking an overflow bug has been fixed, negative int") 3616 "checking an overflow bug has been fixed, negative int")
3617 (Assert (eql (ignore-errors (parse-integer
3618 (format "%d4/" most-negative-fixnum)
3619 :junk-allowed t))
3620 (if (featurep 'bignum)
3621 (- (* most-negative-fixnum 10) 4)
3622 nil))
3623 "checking a bug with :junk-allowed, negative bignum")
3617 (Check-Error invalid-argument (parse-integer "0123456789" 3624 (Check-Error invalid-argument (parse-integer "0123456789"
3618 :radix 8)) 3625 :radix 8))
3619 (Check-Error invalid-argument (parse-integer "abc")) 3626 (Check-Error invalid-argument (parse-integer "abc"))
3620 (Check-Error invalid-argument (parse-integer "efz" :radix 16)) 3627 (Check-Error invalid-argument (parse-integer "efz" :radix 16))
3621 3628