Qurak

ConfirmAssert

可用

Confirms that a test evaluates to True otherwise throwing to the enclosing Enclose

ConfirmAssert[test]
ConfirmAssert[test, info]
ConfirmAssert[test, info, tag]
Enclose[ConfirmAssert[2 > 1];2] → 2Enclose[ConfirmAssert[2 > 3];2] → Failure[ConfirmationFailed, <|MessageTemplate -> Assertion `` failed., MessageParameters -> {HoldForm[2 > 3]}, ConfirmationType -> ConfirmAssert, Expression -> False, Information -> Null, Test -> False, HeldTest -> Hold[2 > 3]|>]Enclose[Echo[1];ConfirmAssert[1 == 0];Echo[2]] → Failure[ConfirmationFailed, <|MessageTemplate -> Assertion `` failed., MessageParameters -> {HoldForm[1 == 0]}, ConfirmationType -> ConfirmAssert, Expression -> False, Information -> Null, Test -> False, HeldTest -> Hold[1 == 0]|>]

主题

相关

全部 6300 个函数 · 从 MCP 客户端使用