bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13543: 24.2; [PATCH] (ert) "wrong-type-argument characterp" when ass


From: Oleksandr Gavenko
Subject: bug#13543: 24.2; [PATCH] (ert) "wrong-type-argument characterp" when assert fail on large (>28 bit) numbers
Date: Mon, 04 Feb 2013 17:33:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

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!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]