~subsetpark/bagatto

ref: f2e3380f4637cb48526d40fea65f0887a7c2ad49 bagatto/test/threads.janet -rw-r--r-- 336 bytes
f2e3380f — Zach Smith Remove threads test 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(import testament :prefix "" :exit true)
(import /src/threads)

(defn dist-job
  [i]
  [i true])

(deftest distribute
  (let [jobs (seq [x :range [0 10]] [dist-job x])
        out (threads/distribute-gather jobs)]

    (is (== @{0 true 2 true 1 true 3 true 5 true
              6 true 4 true 8 true 7 true 9 true} out))))

(run-tests!)