aysylu / loom

Graph library for Clojure. Mailing list https://groups.google.com/forum/#!forum/loom-clj
http://aysy.lu/loom/
886 stars 108 forks source link

fixed: ##Inf in tests #123

Closed johannesloetzsch closed 3 years ago

johannesloetzsch commented 4 years ago

bellman-ford-test failed because Infinity is evaluated as nil.

A minimal fix would be to change Infinity to js/Infinity here:

(def INF #?(:clj Double/POSITIVE_INFINITY
            :cljs Infinity))

Since v1.9.946 ##Inf is supported in Clojure(script) and does the job as expected. I fixed the testcases.

src/loom/alg.cljc works correctly, since it uses js/Infinity and not Infinity. If you want, we could clean it up and use ##Inf there as well?