No matching definitions.

test/assert

src/test/assert.tur
defn

assert-eq

(assert-eq [expected :int actual :int] :bool)

assert two integer values are equal.

expectedthe expected value
actualthe actual value

true if equal, false with a diagnostic if not.

(assert-eq (+ 1 2) 3)  ; => true

Since: P1

defn

assert-ne

(assert-ne [a :int b :int] :bool)

assert two integer values are not equal.

afirst value
bsecond value

true if different, false with a diagnostic if equal.

(assert-ne 1 2)  ; => true

Since: P1

defn

assert-true

(assert-true [x :bool] :bool)

assert a value is truthy.

xthe condition to check

true if truthy, false with a diagnostic otherwise.

(assert-true (> 3 2))  ; => true

Since: P1

defn

assert-false

(assert-false [x :bool] :bool)

assert a value is falsy.

xthe condition to check

true if falsy, false with a diagnostic otherwise.

(assert-false (= 1 2))  ; => true

Since: P1

defn

assert-some

(assert-some [o :int] :bool)

assert an option value is some (non-NULL with is_some=true).

ooption value (opaque :int handle)

true if some, false with a diagnostic if none.

(assert-some (some 42))  ; => true

Since: P1

defn

assert-none

(assert-none [o :int] :bool)

assert an option value is none (NULL or is_some=false).

ooption value (opaque :int handle)

true if none, false with a diagnostic if some.

(assert-none (none))  ; => true

Since: P1

defn

assert-ok

(assert-ok [r :int] :bool)

assert a result value is ok.

rresult value (opaque :int handle)

true if ok, false with a diagnostic if err.

(assert-ok (ok 42))  ; => true

Since: P1

defn

assert-err

(assert-err [r :int] :bool)

assert a result value is err.

rresult value (opaque :int handle)

true if err, false with a diagnostic if ok.

(assert-err (err 1))  ; => true

Since: P1