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
View this message in rfc822 format
Oleksandr Gavenko 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)
> Another problem from (format "?%c" x) is performance penalty when "x"
> is rare character code (font library intensively scan for missing
> character glyph among all system available fonts causing 5 second
> delay and 100% hard disk usage).
This seems like a general issue rather than an ERT one.
> I recommend remove formatting to character as amount of problems are
> larger then amount of benefits.
This bug report was last modified 12 years and 60 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.