# `Croma.DebugAssert`
[🔗](https://github.com/skirino/croma/blob/main/lib/croma/debug_assert.ex#L5)

# `debug_assert`
*macro* 

Ensures that the given expression evaluates to some truthy value at runtime and raises otherwise.

This is intended to be used as debugging purposes: crash immediately when any logic error is found,
similar to `assert()` in C.
However note that, unlike C, crash of the currently running process does not necessarily stop execution of the program.

Runtime checks by `debug_assert/2` can be disabled by setting application config during compilation.

    config :croma, [
      debug_assert: false
    ]

The passed expression should be side effect free in order to preserve code semantics when disabled.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
