From f461265c96dda6adaa0a08cd4234f6b1fad0705b Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Thu, 7 Sep 2006 21:04:56 +0000 Subject: [PATCH] (~f): Test leading zeros bugfix. --- test-suite/tests/format.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test index 3cdc8dc75..6b62e40cf 100644 --- a/test-suite/tests/format.test +++ b/test-suite/tests/format.test @@ -72,6 +72,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")))) + ;;; ;;; ~{ ;;;