~subsetpark/bagatto

ref: import-syntax-update bagatto/test/core.janet -rw-r--r-- 458 bytes
34918929 — Zach Smith Add ignore file 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(import testament :prefix "" :exit true)
(import /src/core)

(defn- test-temple []
  (require "/test/support/test"))

(defn- test-bagatto [] (eval 'bagatto/json-data))

(deftest thread-init
  (def run (fn [parent]
             (test-temple)
             (test-bagatto)
             (:send parent :tests-pass)))

  (assert-thrown (test-temple))
  (assert-thrown (test-bagatto))

  (core/thread-init run)
  (is (= (thread/receive) :tests-pass)))

(run-tests!)