Commit 71fd482d authored by Michał Herda's avatar Michał Herda 🤔 Committed by Daniel Kochmański

Add more cases to FORMAT.F.46

This ensures that 0.01 is printed the same way - as ".0" for
~2f, ~1f, and ~0f.
parent 91e61bee
......@@ -559,9 +559,16 @@
(def-format-test format.f.45b
"~3f" (1.1) "1.1")
;; This fails on ECL 15.3.7
;;; Rationale for FORMAT.F.46: (format nil "~2f ~1f ~0f" 0.01 0.01 0.01) on SBCL
;;; 1.5.7 evaluates to ".0 .01 .01" which is enough for me to state that these
;;; three cases are not a part of one equivalence partition and that testing for
;;; these three cases explicitly is likely to find bugs in implementations:
;;; * ~2f is a case where the resulting float fits in the width;
;;; * ~1f is a case where the resulting float does not fit in the width;
;;; * ~0f is a case where the width is zero and therefore might be handled
;;; specially in the code.
(def-format-test format.f.46
"~0f" (0.01) ".0")
"~2f ~1f ~0f" (0.01 0.01 0.01) ".0 .0 .0")
;; sbcl prints "."
(def-format-test format.f.46b
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment