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:
parent
2660c0b3c8
commit
546eb479b1
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue