1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-11 15:26:07 +00:00

Rename to janet

This commit is contained in:
Calvin Rose
2018-09-05 22:18:42 -04:00
parent 285f2d7ea9
commit c8ef2a0d88
69 changed files with 6199 additions and 6259 deletions

22
test/helper.janet Normal file
View File

@@ -0,0 +1,22 @@
# Helper code for running tests
(var num-tests-passed 0)
(var num-tests-run 0)
(var suite-num 0)
(defn assert [x e]
(++ num-tests-run)
(when x (++ num-tests-passed))
(print (if x
" \e[32m✔\e[0m "
" \e[31m✘\e[0m ") e)
x)
(defn start-suite [x]
(:= suite-num x)
(print "\nRunning test suite " x " tests...\n"))
(defn end-suite []
(print "\nTest suite " suite-num " finished.")
(print num-tests-passed " of " num-tests-run " tests passed.\n")
(if (not= num-tests-passed num-tests-run) (os.exit 1)))