diff tests/automated/lisp-tests.el @ 5295:2474dce7304e

Make sure (format "%b" 0) is non-zero length, print.c src/ChangeLog addition: 2010-10-25 Aidan Kehoe <kehoea@parhasard.net> * print.c (ulong_to_bit_string): If printing zero, actually print a zero, don't return the empty string. tests/ChangeLog addition: 2010-10-25 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Test format strings with %b, too.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 25 Oct 2010 13:15:53 +0100
parents 99de5fd48e87
children 28651c24b3f8 b9167d522a9a
line wrap: on
line diff
--- a/tests/automated/lisp-tests.el	Mon Oct 25 13:04:04 2010 +0100
+++ b/tests/automated/lisp-tests.el	Mon Oct 25 13:15:53 2010 +0100
@@ -1325,8 +1325,11 @@
 ;;-----------------------------------------------------
 (Assert (string= (format "%d" 10) "10"))
 (Assert (string= (format "%o" 8) "10"))
+(Assert (string= (format "%b" 2) "10"))
 (Assert (string= (format "%x" 31) "1f"))
 (Assert (string= (format "%X" 31) "1F"))
+(Assert (string= (format "%b" 0) "0"))
+(Assert (string= (format "%b" 3) "11"))
 ;; MS-Windows uses +002 in its floating-point numbers.  #### We should
 ;; perhaps fix this, but writing our own floating-point support in doprnt.c
 ;; is very hard.