mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-16 10:40:19 +02:00
(~f): Test leading zeros bugfix.
This commit is contained in:
parent
ab4099e4af
commit
f23d8e80f0
1 changed files with 15 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
;;;; format.test --- test suite for Guile's CL-ish format -*- scheme -*-
|
||||
;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
|
||||
;;;;
|
||||
;;;; Copyright (C) 2001, 2004 Free Software Foundation, Inc.
|
||||
;;;; Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This program is free software; you can redistribute it and/or modify
|
||||
;;;; it under the terms of the GNU General Public License as published by
|
||||
|
@ -70,6 +70,20 @@
|
|||
(pass-if "+1"
|
||||
(string=? (format #f "~@d" 1) "+1"))))
|
||||
|
||||
;;;
|
||||
;;; ~f
|
||||
;;;
|
||||
|
||||
(with-test-prefix "~f fixed-point"
|
||||
|
||||
(pass-if "1.5"
|
||||
(string=? "1.5" (format #f "~f" 1.5)))
|
||||
|
||||
;; in guile prior to 1.6.9 and 1.8.1, leading zeros were incorrectly
|
||||
;; stripped, moving the decimal point and giving "25.0" here
|
||||
(pass-if "string 02.5"
|
||||
(string=? "2.5" (format #f "~f" "02.5"))))
|
||||
|
||||
;;;
|
||||
;;; ~{
|
||||
;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue