# std.debug.assert: remove special case for test builds · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c2db077574be841da586fa62d67619c901dd535d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c2db077574be841da586fa62d67619c901dd535d

Requested commit: c2db077574be841da586fa62d67619c901dd535d

Commit: c2db077574be841da586fa62d67619c901dd535d

Tree: c8eb64846fa7ffb9027fa1ca035dd8ca5712b9d4

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.debug.assert: remove special case for test builds

Previously, std.debug.assert would `@panic` in test builds,
if the assertion failed. Now, it's always `unreachable`.

This makes release mode test builds more accurately test
the actual code that will be run.

However this requires tests to call `std.testing.expect`
rather than `std.debug.assert` to make sure output is correct.

Here is the explanation of when to use either one, copied from
the assert doc comments:

Inside a test block, it is best to use the `std.testing` module
rather than assert, because assert may not detect a test failure
in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert
is the correct function to use.

closes #1304

```

## Parents

- [be6d022257d8d7e99bd080823d4d8f0175f320c5](https://git.cafe/gitcafe/zig/commit/be6d022257d8d7e99bd080823d4d8f0175f320c5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c2db077574be841da586fa62d67619c901dd535d?format=markdown)
