comparison tests/automated/lisp-reader-tests.el @ 5489:159face738c3

Never pass a leading + to mpz_set_string, parse_integer (). src/ChangeLog addition: 2011-05-01 Aidan Kehoe <kehoea@parhasard.net> * lread.c (parse_integer): GMP's mpz_set_string deals with a leading plus badly, make sure it never sees one coming from this function. tests/ChangeLog addition: 2011-05-01 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-reader-tests.el: If the bignum feature is available, check that a leading plus sign is treated correctly when reading bignum integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 01 May 2011 13:51:33 +0100
parents b9167d522a9a
children 58b38d5b32d0
comparison
equal deleted inserted replaced
5488:1e544fd7be12 5489:159face738c3
74 )) 74 ))
75 (with-temp-buffer 75 (with-temp-buffer
76 (insert string) 76 (insert string)
77 (Check-Error-Message invalid-read-syntax "unrecognized raw string" 77 (Check-Error-Message invalid-read-syntax "unrecognized raw string"
78 (eval-buffer)))) 78 (eval-buffer))))
79
80 (when (featurep 'bignum)
81 ;; This failed, up to 20110501.
82 (Assert (eql (1+ most-positive-fixnum)
83 (read (format "+%d" (1+ most-positive-fixnum))))
84 "checking leading + is handled properly if reading a bignum")
85 ;; This never did.
86 (Assert (eql (1- most-positive-fixnum)
87 (read (format "+%d" (1- most-positive-fixnum))))
88 "checking leading + is handled properly if reading a fixnum"))
89