require(1 == 2).assertErrorsWith("requirement failed."); require(1 == 2, "%s is not true").assertErrorsWith("%s is not true"); require(1 == 2, "%s is not true", "1 == 2").assertErrorsWith("1 == 2 is not true"); require(1 == 1).assertErrorsWith("requirement failed.") .assertErrorsWith("Error: No exception was thrown.");
Verify that calling expr throws and contains the exception message msg.