言語アイコン
翻訳率
26%
言語アイコン
未翻訳

このページはまだ翻訳されていません。原文の内容が表示されています。

assert

Ensures that a condition is fulfilled.

Fails with an error if the condition is not fulfilled. Does not produce any output in the document.

If you wish to test equality between two values, see assert.eq and assert.ne.

Example

#assert(1 < 2, message: "math broke")

引数

condition
必須引数
位置引数

The condition that must be true for the assertion to pass.

message

The error message when the assertion fails.

定義

eq

Ensures that two values are equal.

Fails with an error if the first value is not equal to the second. Does not produce any output in the document.

assert.eq(
any
,
any
,
)
右矢印アイコン
例を表示
#assert.eq(10, 10)

left
any
必須引数
位置引数

The first value to compare.

right
any
必須引数
位置引数

The second value to compare.

message

An optional message to display on error instead of the representations of the compared values.

ne

Ensures that two values are not equal.

Fails with an error if the first value is equal to the second. Does not produce any output in the document.

assert.ne(
any
,
any
,
)
右矢印アイコン
例を表示
#assert.ne(3, 4)

left
any
必須引数
位置引数

The first value to compare.

right
any
必須引数
位置引数

The second value to compare.

message

An optional message to display on error instead of the representations of the compared values.