unit testing - How to map a test onto a list of numbers -


I have a bug with a function:

  User & gt; (- 42-inch-to-byte byte-to-enter) 42 users & gt; (- 128-inch-to-byte byte-to-int) -128 users & gt;  

It seems that it is necessary to handle overflow while converting me back ...

Write better to ensure that this never happens This project is using clojure.contrib.test- so I write:

  (deftest int-to-bytes-to-int (let [many-large-numbers ( Big-test-notes]] (map # (is (= (- - gt;% int-to-bytes-by-int)%)) Very large numbers)))  
< P> This test is done by doing a bit of bytes. Should and produces original results on the list of 10,000 random numbers again. Seems fine in theory? None of the tests except one are run.

  are testing com.cryptovide.miscTest runs 0 failures in test 0 failures, 0 errors              

dorun + map => doseq

  (doseq [x (big-test-number)] (is (= x (-> x int-by-bytes bytes-to-int))  

Comments