Skip to main content

rl_lang/docs/entries/stdlib/debug/
assert.rs

1use crate::docs::entry::FnEntry;
2
3pub static ASSERT: FnEntry = FnEntry {
4    signature: "assert(cond, msg?)",
5    description: "errors if `cond` is false, using `msg` if provided or the default \"assertion failed\"",
6    example: r#"
7get std::debug::assert
8
9assert(1 + 1 == 2)
10assert(false, \"should never happen\")"#,
11    expected_output: Some("errors: should never happen"),
12    returns: "null",
13    errors: Some("raises a runtime error when `cond` is not true"),
14    see_also: &["assert_eq", "assert_ne"],
15    since: Some("v0.1.5"),
16};