1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-30 13:58:05 +00:00

Add defer and assert to the core.

This commit is contained in:
Calvin Rose
2020-01-15 22:38:06 -06:00
parent bc2bac8cd3
commit 65be9ae095
4 changed files with 30 additions and 9 deletions

View File

@@ -6,7 +6,9 @@
(var numchecks 0)
(var start-time 0)
(defn assert [x e]
(defn assert
"Override's the default assert with some nice error handling."
[x e]
(++ num-tests-run)
(when x (++ num-tests-passed))
(if x