~subsetpark/bagatto

ref: 37b87a808c37b933f5d830bff18d352130f64c06 bagatto/test/require.janet -rw-r--r-- 430 bytes
37b87a80 — Zach Smith Add thread init test 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(import testament :prefix "" :exit true)
(import src/env)

(setdyn :executable-blacklist {})

(deftest in-place
  (env/defrequire "ls" should-run [] :ok)
  (env/prepare-root-env!)
  (env/setdyn-blacklist!)
  (is (= :ok (should-run))))

(deftest not-in-place
  (env/defrequire "this-application-cannot-be-found" should-fail [] :ok)
  (env/prepare-root-env!)
  (env/setdyn-blacklist!)
  (assert-thrown (should-fail)))

(run-tests!)