summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2016-12-15 12:47:08 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2016-12-15 12:47:08 +0100
commit546eb479b1fc7e3143b05aaeec16175d1cea0e08 (patch)
tree2e83b63b8704bb0aa8209547fbd940a5f4db51aa /test-suite
parent2660c0b3c86bf76fab465c200a5ca20fb37cf811 (diff)
Test format ~f with width parameters
* test-suite/tests/format.test: Additional tests for ~f.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/tests/format.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test
index cc31942cc..e7b7afde8 100644
--- a/test-suite/tests/format.test
+++ b/test-suite/tests/format.test
@@ -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