owa-rs/modules/core/assert.owa
2026-05-06 12:21:06 +03:00

17 lines
No EOL
339 B
Text

(namespace assert
(defmacro ok! [] (if (bool.and $%&)
:true
(throw! "assertion failed")))
(defmacro not! [] (if (bool.and $%&)
(throw! "assertion failed")
:true))
(defmacro eq! [] (if-eq $(%&)
:true
(throw! "assertion failed")))
(defmacro nq! [] (if-eq $(%&)
(throw! "assertion failed")
:true))
)