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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user