1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-03 09:03:02 +00:00

Add errorParent to threads.

This commit is contained in:
Calvin Rose
2017-06-19 23:01:34 -04:00
parent 6c597f6b5b
commit 70478a410b
12 changed files with 90 additions and 32 deletions

View File

@@ -1,11 +1,8 @@
# Define assert
(do
(: assert (fn [x e] (if x x (do (print e) (exit 1)))))
# Basic Math
(assert (= 10 (+ 1 2 3 4), "addition")
(assert (= -8 (- 1 2 3 4), "subtraction")
(assert (= 24 (* 1 2 3 4), "multiplication")
(assert (= 0.1 (/ 1 10), "division")
# All good
(assert (= 10 (+ 1 2 3 4)) "addition")
(assert (= -8 (- 1 2 3 4)) "subtraction")
(assert (= 24 (* 1 2 3 4)) "multiplication")
(assert (= 0.1 (/ 1.0 10)) "division")
(exit 0)
)