parse-float icon indicating copy to clipboard operation
parse-float copied to clipboard

Add randomized tests

Open stylewarning opened this issue 9 years ago • 3 comments

It's possible to do more comprehensive testing with randomized tests. Something like

(let ((r (random most-positive-double-float)))
  (= r (parse-float:parse-float (prin1-to-string r) :type 'double-float
                                                    :exponent-character #\d)))

stylewarning avatar Jul 06 '16 04:07 stylewarning

Nice idea.

Do you now if random states are the same across all platforms? I would hate it if test 213 fails on one computer and I cannot reproduce it on mine.

soemraws avatar Oct 11 '16 17:10 soemraws

Random states are definitely not portable, unfortunately.

For single floats, we may opt to just test them all. Why not?

stylewarning avatar Oct 01 '17 06:10 stylewarning