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