GNU bug report logs -
#13543
24.2; [PATCH] (ert) "wrong-type-argument characterp" when assert fail on large (>28 bit) numbers
Previous Next
Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Date: Thu, 24 Jan 2013 20:34:02 UTC
Severity: normal
Tags: patch
Found in version 24.2
Fixed in version 24.4
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 13543 <at> debbugs.gnu.org (full text, mbox):
On 2013-02-04, Glenn Morris wrote:
>> 'should' from lisp/emacs-lisp/ert.el fail to create character from
>> number, for example evaluate one of these expressions:
>>
>> (should (equal #x1000000 1))
>> (should (equal 1 -1))
>
> I can see some usefulness to printing the character form for something
> like
>
> (should (equal ?a ?b))
>
> so I installed this change:
>
> ***************
> *** 568,574 ****
> (defun ert--explain-format-atom (x)
> "Format the atom X for `ert--explain-equal'."
> (cl-typecase x
> ! (fixnum (list x (format "#x%x" x) (format "?%c" x)))
> (t x)))
>
> (defun ert--explain-equal-rec (a b)
> --- 568,575 ----
> (defun ert--explain-format-atom (x)
> "Format the atom X for `ert--explain-equal'."
> (cl-typecase x
> ! (character (list x (format "#x%x" x) (format "?%c" x)))
> ! (fixnum (list x (format "#x%x" x)))
> (t x)))
>
> (defun ert--explain-equal-rec (a b)
>
Your idea look good to me. I think about it but afraid inconsistent of output
(print 3 filed for character and 2 for fixnum). That is why I don't suggest
this solution...
One essential point is that if some test check fail all followed tests doesn't
executed due to this bug. So this must be fixed in any way...
--
Best regards!
This bug report was last modified 12 years and 44 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.