assert
参数参数参数是传给函数的输入,写在函数名后的括号中。
参数
参数是传给函数的输入,写在函数名后的括号中。
assert(,)condition
conditionThe condition that must be true for the assertion to pass.
message
messageThe error message when the assertion fails.
定义定义这些函数和类型带有附属定义。要访问这种定义,请先写上函数或类型的名称,再加上定义的名称,并用句点在中间分隔。
定义
这些函数和类型带有附属定义。要访问这种定义,请先写上函数或类型的名称,再加上定义的名称,并用句点在中间分隔。
eq
eqEnsures 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(10, 10)
assert.eq(any,any,)leftany必需参数必需参数必需参数在调用函数时必须传入。位置参数位置参数位置参数按顺序传入,不带参数名。
leftany
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。
The first value to compare.
rightany必需参数必需参数必需参数在调用函数时必须传入。位置参数位置参数位置参数按顺序传入,不带参数名。
rightany
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。
The second value to compare.
message
messageAn optional message to display on error instead of the representations of the compared values.
ne
neEnsures 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(3, 4)
assert.ne(any,any,)leftany必需参数必需参数必需参数在调用函数时必须传入。位置参数位置参数位置参数按顺序传入,不带参数名。
leftany
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。
The first value to compare.
rightany必需参数必需参数必需参数在调用函数时必须传入。位置参数位置参数位置参数按顺序传入,不带参数名。
rightany
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。
The second value to compare.
message
messageAn optional message to display on error instead of the representations of the compared values.