testing

Alys Brooks 2022-03-29T00:08:48.151039Z

I'm looking to port some statistical code from ClojureScript to Clojure, and I'm wondering if there are any techniques for validating that the calculations return the same results running on the JVM as they do in the JavaScript runtime. I don't think the math is wrong per se, just that rounding or other representational differences might lead to slightly different numbers. Probably what I will do is write some unit tests that test both versions of the function, but I'm wondering if there's a better way.

Alys Brooks 2022-04-05T15:37:28.926979Z

Thanks for the suggestion! I'll take a look. (And inadvertently, I waited 4 days to respond.)

pithyless 2022-04-01T21:09:57.475329Z

You might want to take a look at https://github.com/quoll/cljs-math - since Paula worked on figuring how to port (and test) the clojure.math namespace from CLJ to CLJS.

pithyless 2022-04-01T21:12:08.773749Z

@actuallyalys_slack - I just realized I'm replying to a 4 days old thread. :)