std.debug.assert should not be special-cased in test mode #1304
Labels
accepted
This proposal is planned.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Here's the current implementation of
std.debug.assert
:We turn asserts into calls to
@panic
in test mode so thatassert()
in tests will be guaranteed to panic in ReleaseFast and ReleaseSmall modes.@thejoshwolfe pointed out that the point of testing in ReleaseFast mode and ReleaseSmall mode is to test the actual code that will be run in these modes. So instead of changing the behavior of
assert
in these modes, we should have a different function to call during testing, and keep asserts in the implementation code.The text was updated successfully, but these errors were encountered: