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: Glenn Morris
Subject: bug#13543: 24.2; [PATCH] (ert) "wrong-type-argument characterp" when assert fail on large (>28 bit) numbers
Date: Mon, 04 Feb 2013 02:49:05 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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.





reply via email to

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