[Git][cmucl/cmucl][issue-275b-signal-float-underflow] Add tests for float underflows in the reader
Raymond Toy pushed to branch issue-275b-signal-float-underflow at cmucl / cmucl Commits: 45532060 by Raymond Toy at 2024-03-23T14:56:58-07:00 Add tests for float underflows in the reader - - - - - 1 changed file: - tests/float.lisp Changes: ===================================== tests/float.lisp ===================================== @@ -212,3 +212,17 @@ ;; most-positive-double-float. And a really big single-float. (assert-error 'reader-error (read-from-string "1.8d308")) (assert-error 'reader-error (read-from-string "1d999999999"))) + +(define-test reader.float-underflow + (:tag :issues) + (lisp::with-float-traps-enabled (:underflow) + ;; A denormal + (assert-error 'floating-point-underflow + (read-from-string "1e-40")) + (assert-error 'floating-point-underflow + (read-from-string (format nil "~A" least-positive-single-float))) + ;; The same for double-floats + (assert-error 'floating-point-underflow + (read-from-string "1d-308")) + (assert-error 'floating-point-underflow + (read-from-string (format nil "~A" least-positive-double-float))))) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/45532060060f711842edbfbc... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/45532060060f711842edbfbc... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)