1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

Test format ~f with width parameters

* test-suite/tests/format.test: Additional tests for ~f.
This commit is contained in:
Daniel Llorens 2016-12-15 12:47:08 +01:00
parent 2660c0b3c8
commit 546eb479b1

View file

@ -108,6 +108,15 @@
(pass-if "3/2"
(string=? "1.5" (format #f "~f" 3/2)))
(pass-if "~2f"
(string=? "10." (format #f "~2f" 9.9)))
(pass-if "~2,1f"
(string=? "9.9" (format #f "~2,1f" 9.9)))
(pass-if "~2,2f"
(string=? "9.90" (format #f "~2,2f" 9.9)))
;; 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