comparison 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
comparison
equal deleted inserted replaced
5294:bbff29a01820 5295:2474dce7304e
1323 ;;----------------------------------------------------- 1323 ;;-----------------------------------------------------
1324 ;; format test 1324 ;; format test
1325 ;;----------------------------------------------------- 1325 ;;-----------------------------------------------------
1326 (Assert (string= (format "%d" 10) "10")) 1326 (Assert (string= (format "%d" 10) "10"))
1327 (Assert (string= (format "%o" 8) "10")) 1327 (Assert (string= (format "%o" 8) "10"))
1328 (Assert (string= (format "%b" 2) "10"))
1328 (Assert (string= (format "%x" 31) "1f")) 1329 (Assert (string= (format "%x" 31) "1f"))
1329 (Assert (string= (format "%X" 31) "1F")) 1330 (Assert (string= (format "%X" 31) "1F"))
1331 (Assert (string= (format "%b" 0) "0"))
1332 (Assert (string= (format "%b" 3) "11"))
1330 ;; MS-Windows uses +002 in its floating-point numbers. #### We should 1333 ;; MS-Windows uses +002 in its floating-point numbers. #### We should
1331 ;; perhaps fix this, but writing our own floating-point support in doprnt.c 1334 ;; perhaps fix this, but writing our own floating-point support in doprnt.c
1332 ;; is very hard. 1335 ;; is very hard.
1333 (Assert (or (string= (format "%e" 100) "1.000000e+02") 1336 (Assert (or (string= (format "%e" 100) "1.000000e+02")
1334 (string= (format "%e" 100) "1.000000e+002"))) 1337 (string= (format "%e" 100) "1.000000e+002")))