Skip to content
Snippets Groups Projects
Commit 80e955c9 authored by Daniel Kochmański's avatar Daniel Kochmański Committed by Daniel Kochmański
Browse files

format-f: Add additional tests checking, if 0 is handled correctly.

parent 2a5c85ba
No related branches found
No related tags found
No related merge requests found
...@@ -535,11 +535,17 @@ ...@@ -535,11 +535,17 @@
collect (list i c f1 s1 s2)) collect (list i c f1 s1 s2))
nil) nil)
(deftest format.f.45 (def-format-test format.f.45
(let ((fn (formatter "~2f"))) "~0f" (1.1) "1.1")
(loop for x in (remove-duplicates '(1 1.1s0 1.1f0 1.1d0 1.1l0))
for s = (format nil "~2f" x) ;; This fails on ECL 15.3.7
for s2 = (formatter-call-to-string fn x) (def-format-test format.f.46
unless (and (string= s "1.1") (string= s s2)) "~0f" (0.01) ".0")
collect (list x s s2)))
nil) ;; sbcl prints "."
(def-format-test format.f.46b
"~0,0f" (0.01) "0.")
;; Most implementations print .00
(def-format-test format.f.47
"~3f" (0.000001) "0.0")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment