aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-07-20 13:59:18 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-07-20 13:59:18 -0400
commita2e1be0346c364c4327dc2b81bbcdeca12414dab (patch)
tree36c6f9997730a7dcc59ebfcd2ceca7fb3a687d4b /doc
parent2c1e955de7a8f31666c751ce4f69c47d4c1b822e (diff)
downloadzig-a2e1be0346c364c4327dc2b81bbcdeca12414dab.tar.gz
zig-a2e1be0346c364c4327dc2b81bbcdeca12414dab.zip
docs: don't try to run the undefined behavior example test
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index b5fe464c35..2372d32afa 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -8990,8 +8990,7 @@ pub fn assert(ok: bool) void {
This means that when testing in ReleaseFast or ReleaseSmall mode, {#syntax#}assert{#endsyntax#}
is not sufficient to check the result of a computation:
</p>
- {#code_begin|test|assert#}
- {#code_release_fast#}
+ {#code_begin|syntax#}
const std = @import("std");
const assert = std.debug.assert;
@@ -8999,9 +8998,11 @@ test "assert in release fast mode" {
assert(false);
}
{#code_end#}
- <p>Note that although the above example shows the test passing, this is invoking
- unchecked {#link|Undefined Behavior#}. This documentation is showing only one possible
- outcome of this test.</p>
+ <p>
+ When compiling this test in {#link|ReleaseFast#} mode, it invokes unchecked
+ {#link|Undefined Behavior#}. Since that could do anything, this documentation
+ cannot show you the output.
+ </p>
<p>
Better practice for checking the output when testing is to use {#syntax#}std.testing.expect{#endsyntax#}:
</p>